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

pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2110


in linking some of os executables are linking name some of them

1910


Write a program to identify if a given binary tree is balanced or not.

928


what is the diffrenet bettwen HTTP and internet protocol

1603


difference between native and cross compilers

1887


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1719


Explain how can I remove the trailing spaces from a string?

825


How many header files are in c?

762


What does the characters “r” and “w” mean when writing programs that will make use of files?

1199


If fflush wont work, what can I use to flush input?

855


What is difference between stdio h and conio h?

1113


What is #error and use of it?

928


What are the disadvantages of external storage class?

823


Compare interpreters and compilers.

834


Can include files be nested? How many levels deep can include files be nested?

876