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
How to declare a variable?
When should volatile modifier be used?
I came across some code that puts a (void) cast before each call to printf. Why?
Explain what does a function declared as pascal do differently?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
Difference between MAC vs. IP Addressing
What is the mean of function?
What is the role of && operator in a program code?
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......
Explain how to reverse singly link list.
Is array a primitive data type in c?
What is bash c?
How many types of operators are there in c?
Explain how do you determine the length of a string value that was stored in a variable?
Write a program to reverse a string.