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

Answer Posted / sumalatha

Ans is 2 2 2
because in printf assosiativity is from left to right
first pre increments i that becomes 2 next post increment
is done after printf stmt so prints 2 again, then simple
print i i.e 2again
last post increnent which i becomes 3 but that is done
after printf stmt

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are identifiers c?

560


How do you sort filenames in a directory?

708


I need previous papers of CSC.......plz help out by posting them.......

1814


What is main return c?

513


hi, which software companys will take,if d candidate's % is jst 55%?

1659






What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1293


What is array of structure in c?

593


what do you mean by enumeration constant?

594


What is LINKED LIST? How can you access the last element in a linked list?

629


What are the different types of constants?

638


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

760


What are the types of i/o functions?

677


What is the advantage of c?

607


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

738


What is the difference between printf and scanf in c?

745