void main()
{
int a=1;
printf("%d %d %d",a,++a,a++);
}
the output is supposed to be 1 2 2....but it is 3 3 1
this is due to calling conventions of C. if anyone can
explain me how it happens?
Answer Posted / keerthi
while printing the output it starts from right hand
side ..so first 'a++' value is printed then '++a' value and
last it prints 'a' value
| Is This Answer Correct ? | 12 Yes | 16 No |
Post New Answer View All Answers
How to implement a packet in C
What does volatile do?
Is it better to bitshift a value than to multiply by 2?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
How can you tell whether a program was compiled using c versus c++?
What is a volatile keyword in c?
How many parameters should a function have?
What is a null pointer in c?
What is a char in c?
What is the return type of sizeof?
what is the format specifier for printing a pointer value?
How many header files are in c?
What are enumerated types?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
Explain how can a program be made to print the line number where an error occurs?