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
What is c language in simple words?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
I heard that you have to include stdio.h before calling printf. Why?
How do you print only part of a string?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
What does %c mean in c?
Explain how can a program be made to print the name of a source file where an error occurs?
When a c file is executed there are many files that are automatically opened what are they files?
What are the disadvantages of a shell structure?
What is c system32 taskhostw exe?
What is the purpose of 'register' keyword in c language?
Explain what does a function declared as pascal do differently?
What is keyword in c?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What should malloc() do?