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
Explain what does the function toupper() do?
How does selection sort work in c?
Why isn't any of this standardized in c? Any real program has to do some of these things.
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 []);
Why malloc is faster than calloc?
develop algorithms to add polynomials (i) in one variable
What are different types of variables in c?
about c language
Lists the benefits of c programming language?
What is f'n in math?
How can type-insensitive macros be created?
What is void c?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
How can you invoke another program from within a C program?
Explain what is the difference between far and near ?