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


Please Help Members By Posting Answers For Below Questions

Is c procedural or functional?

593


How can I write a function that takes a format string and a variable number of arguments?

609


What is getch?

636


Explain what is the best way to comment out a section of code that contains comments?

726


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

651






The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

638


What is identifiers in c with examples?

680


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

639


Explain what is #line used for?

610


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

652


How can I copy just a portion of a string?

822


What is function prototype?

613


Dont ansi function prototypes render lint obsolete?

612


What is call by reference in functions?

573


How can you increase the size of a statically allocated array?

622