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 / keerthi
while printing the output it starts from right hand
side ..so first 'a++' value is printed then '++a' value and
last it prints 'a' value
| Is This Answer Correct ? | 12 Yes | 16 No |
Post New Answer View All Answers
how to find binary of number?
What is cohesion in c?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Write a Program to accept different goods with the number, price and date of purchase and display them
Explain how can you avoid including a header more than once?
What functions are in conio h?
What is volatile variable in c with example?
What is modifier & how many types of modifiers available in c?
Difference between macros and inline functions? Can a function be forced as inline?
What is the use of volatile?
Apart from dennis ritchie who the other person who contributed in design of c language.
write a programming in c to find the sum of all elements in an array through function.
Can we assign integer value to char in c?
Explain how can I write functions that take a variable number of arguments?
How can a string be converted to a number?