C program is one of most popular programming language which is used for core level of coding across the board. C program is used for operating systems, embedded systems, system engineering, word processors,hard ware drivers, etc.
In this site, we have discussed various type of C programs till date and from now on, we will move further by looking at the C aptitude questions.
In the coming days, we will post C aptitude questions, answers and explanation for interview preparations.
The C aptitude questions and answers for those questions along with explanation for the interview related queries.
We hope that this questions and answers series on C program will help students and freshers who are looking for a job, and also programmers who are looking to update their aptitude on C program.
Some of the illustrated examples will be from the various companies, and IT industry experts.
Read more about C Programming Language . and read the C Programming Language (2nd Edition). by K and R.
Predict the output or error(s) for the following:
C aptitude 13.1
ain()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
}
Answer: 1
Explanation: before entering into the for loop the checking condition is “evaluated”. Here it evaluates to 0 (false) and comes out of the loop, and i is incremented (note the semicolon after the for loop).
C aptitude 13.2
main()
{
char s[]={'a','b','c','n','c','