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 / vishnu
first calculations will be done from right to left and then
prints accroding to the parameters passed.
Is This Answer Correct ? | 29 Yes | 8 No |
Post New Answer View All Answers
What are the 5 data types?
What are the advantages of union?
Why pointers are used in c?
how do you execute a c program in unix.
What is derived datatype in c?
Where in memory are my variables stored?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What is void pointers in c?
What is difference between arrays and pointers?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What does %c do in c?
How many main () function we can have in a project?
The file stdio.h, what does it contain?
Explain what header files do I need in order to define the standard library functions I use?
Is main is user defined function?