main()
{
int i=5;
printf("%d%d%d%d",i++,i--,i);
}
Answer Posted / sravankumar
printf() function evaluates from right to left
printf("\n %d %d %d",i++,i--,i);
4 5 5
<- <- <- <- <-evaluation of expression
but prints as the way we mentioned in printf() function
i.e first i = 5
then i--= 5 because it is post decrement
then i++= 4 this because i is decremented in above, and
not incremented immediately because is post
increment
So output is : 4 5 5
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Difference between malloc() and calloc() function?
Describe explain how arrays can be passed to a user defined function
What is typedf?
What is an endless loop?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
Is it better to use a macro or a function?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
What are the 32 keywords in c?
What is an identifier?
Explain modulus operator. What are the restrictions of a modulus operator?
What is the purpose of macro in C language?
What is the purpose of 'register' keyword in c language?
What math functions are available for integers? For floating point?
Why array is used in c?