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
Is c procedural or functional?
How can I write a function that takes a format string and a variable number of arguments?
What is getch?
Explain what is the best way to comment out a section of code that contains comments?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What is identifiers in c with examples?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Explain what is #line used for?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
How can I copy just a portion of a string?
What is function prototype?
Dont ansi function prototypes render lint obsolete?
What is call by reference in functions?
How can you increase the size of a statically allocated array?