main()
{
int i = -3,j=2,k=0,m;
m= ++i || ++j && ++k;
printf("%d%d%d",i,j,k,m);
}

Answer Posted / nidhi yadav

here logical && has higher priority than ||. so the block
(++j&&++k)will execute first and ans of this will be (3&&1=0)
since value increment first due to preincrement operator. now
the block(++i||0)will execute as (-2||0=1) since || opertor always gives true value except(0||0=0).
thus ans will be i=-2,j=3,k=1,m=1

Is This Answer Correct ?    2 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to declare a variable?

676


When should volatile modifier be used?

652


I came across some code that puts a (void) cast before each call to printf. Why?

802


Explain what does a function declared as pascal do differently?

752


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5570






Difference between MAC vs. IP Addressing

727


What is the mean of function?

752


What is the role of && operator in a program code?

655


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1493


Explain how to reverse singly link list.

701


Is array a primitive data type in c?

663


What is bash c?

648


How many types of operators are there in c?

710


Explain how do you determine the length of a string value that was stored in a variable?

766


Write a program to reverse a string.

726