main()
{
int i = 10;
printf(" %d %d %d \n", ++i, i++, ++i);
}
Answer Posted / dhivya
11 11 13
++i which means i is first incremented and then printed thus i value becomes 11,
i++ which means i is printed and then it is incremented, since the value of i is now 11, it is printed and then incremented to 12.
again ++i , increments i to 13 and then prints.
Is This Answer Correct ? | 66 Yes | 38 No |
Post New Answer View All Answers
Describe the modifier in c?
What is typedef?
What is the method to save data in stack data structure type?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is structure pointer in c?
what is the difference between 123 and 0123 in c?
How can you find out how much memory is available?
What is getch?
Is null a keyword in c?
Is int a keyword in c?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
What is pointer in c?
Is c++ based on c?
what do you mean by inline function in C?