what is the output for this question:
main()
{
int i=1;
printf("%d%d%d",i,i++,++i);
}

Answer Posted / r.aruna

answer is 3,2,2
because print the value form right to left.
so,the first one ++i means preincrement.
so,incremented one,2
second one is i++ means postincrement .
it doesn't increment store in same location
but next i means 3.because move to next location

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better pointer or array?

594


What are the features of the c language?

640


What is static identifier?

701


Do pointers need to be initialized?

556


What will be the outcome of the following conditional statement if the value of variable s is 10?

755






write a programming in c to find the sum of all elements in an array through function.

1702


Why do we use return in c?

563


What are the difference between a free-standing and a hosted environment?

737


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1491


Which are low level languages?

629


What are the types of data files?

723


What is a structure in c language. how to initialise a structure in c?

603


Explain what is meant by 'bit masking'?

639


Explain what is gets() function?

624


Explain what is wrong with this program statement? Void = 10;

761