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

All,

output of above code is compiler depended i.e the order of
evalulation.

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of external class?

833


What is the difference between functions abs() and fabs()?

914


Do you know what are the properties of union in c?

831


Explain what are its uses in c programming?

839


What are c identifiers?

879


Where static variables are stored in c?

834


How can you find the exact size of a data type in c?

812


What is the difference between a string and an array?

961


What is define directive?

889


Explain 'far' and 'near' pointers in c.

931


Is a house a mass structure?

885


Which node is more powerful and can handle local information processing or graphics processing?

1114


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2447


What are categories used for in c?

842


What is the benefit of using const for declaring constants?

833