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
Explain what is wrong in this statement?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
What does typeof return in c?
What is a structure and why it is used?
What is union and structure?
can anyone please tell about the nested interrupts?
How can I copy just a portion of a string?
What is a pointer value and address in c?
What are the valid places to have keyword “break”?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
What are all different types of pointers in c?
Why c is called a middle level language?
What is main () in c language?
How can I write a function that takes a format string and a variable number of arguments?
Tell us bitwise shift operators?