what is the output for this question:
main()
{
int i=1;
printf("%d%d%d",i,i++,++i);
}
Answer Posted / sumalatha
Ans is 2 2 2
because in printf assosiativity is from left to right
first pre increments i that becomes 2 next post increment
is done after printf stmt so prints 2 again, then simple
print i i.e 2again
last post increnent which i becomes 3 but that is done
after printf stmt
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
swap 2 numbers without using third variable?
Explain what is the stack?
How many keywords (reserve words) are in c?
How can you invoke another program from within a C program?
What is meant by operator precedence?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What are identifiers and keywords in c?
How can I make sure that my program is the only one accessing a file?
What is the use of pragma in embedded c?
What is the difference between struct and typedef struct in c?
Is fortran still used today?
What is the meaning of 2d in c?
In a switch statement, explain what will happen if a break statement is omitted?
Why static variable is used in c?
What does the c in ctime mean?