main()
{
int i = 10;
printf(" %d %d %d \n", ++i, i++, ++i);
}

Answer Posted / krityangan

The Answer is 13 11 13
because the post increment will printed first and then pre.
i=10
the ++i=11,i++=12,++i=13,but in c the compiler will print ++p which is now 13 and after that when the compiler come to i++ it will print 11 because in the pre addition the previous vale is printed first andthan i= 12.

Is This Answer Correct ?    27 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are predefined functions in c?

568


What are operators in c?

583


What does it mean when the linker says that _end is undefined?

634


what is the difference between 123 and 0123 in c?

722


What is the use of sizeof?

556






Write a program to swap two numbers without using third variable?

814


Is c is a middle level language?

597


In a header file whether functions are declared or defined?

629


What are the differences between new and malloc in C?

610


Who is the main contributor in designing the c language after dennis ritchie?

553


Why does this code crash?

619


Are pointers really faster than arrays?

562


What is scanf () in c?

662


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

659


What does %d do in c?

545