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


Please Help Members By Posting Answers For Below Questions

Explain what does the function toupper() do?

627


How does selection sort work in c?

611


Why isn't any of this standardized in c? Any real program has to do some of these things.

617


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

1832


Why malloc is faster than calloc?

580






develop algorithms to add polynomials (i) in one variable

1729


What are different types of variables in c?

563


about c language

1595


Lists the benefits of c programming language?

580


What is f'n in math?

609


How can type-insensitive macros be created?

689


What is void c?

558


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2328


How can you invoke another program from within a C program?

609


Explain what is the difference between far and near ?

639