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 / sathish

execution does from right to left and while printing it goes from left to right.

Is This Answer Correct ?    18 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why doesnt that code work?

604


What is operator promotion?

635


Explain how can a program be made to print the line number where an error occurs?

700


How can you access memory located at a certain address?

671


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

718






why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1323


When is a “switch” statement preferable over an “if” statement?

653


What is quick sort in c?

588


write a c program for swapping two strings using pointer

2100


What is the difference between the = symbol and == symbol?

631


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

1895


Write a program to use switch statement.

663


What is the purpose of macro in C language?

668


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

810


How many types of operators are there in c?

623