20. main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
}
Answer:??????

Answer Posted / ashish

The only concept here is that the printf starts 'generating'
results from RHS to LHS.
Hence, in the process of generation: i=5; then --i=4; ++i=5;
i--=5(due to the postfix concept, but after finishing this
calculation i=4); now i++=4(after performing i++, the value
of 'i' is 5, but for printing, due to the postfix concept,
i=4, the current value of 'i' will be printed).

The printing happens in order from LHS to RHS. Hence these
values are printed as 4 5 5 4 5.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

752


What is .obj file in c?

650


What is a function simple definition?

625


What is a lookup table in c?

630


how to find binary of number?

3447






write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

1851


How can I change the size of the dynamically allocated array?

636


In a header file whether functions are declared or defined?

633


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1455


Is c procedural or functional?

593


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1262


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3192


What is realloc in c?

582


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

1744


Can we declare function inside main?

572