#include<stdio.h>
int main()
{ int i=0,j=1,k=2,m,n=0;
m=i++&&j++&&k++||n++;
printf("%d,%d,%d,%d,%d",i,j,k,m,n);
}

Answers were Sorted based on User's Feedback



#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / santhoshrpai

1,1,2,0,1

Is This Answer Correct ?    41 Yes 10 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / g krishna rao

1,1,2,0,1

when it encounters zero it will not check remaining conditions
and go to or conditions and incriment n

Is This Answer Correct ?    3 Yes 2 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / aravind

0,1,2,0,0

Is This Answer Correct ?    11 Yes 11 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / manish soni tagore collage jai

m=i++&&j++&&k++||n++;
in this expression
first
m=0++&&...........
from rule of && opr c1&&c2
if c1 is 0(FLASE) it don't chacke the next expression
so
m=0---------------(1);

after this
m=i++&&j++&&k++||n++;
-----------------------
m=i++&&j++&&k++ is flase so only i is increase by and j and
k not effect.
-------------------------------
after that
in ||(OR )OPR
C1||C2
IF C1 IS 0(FALSE) THEN IT CHECK THE C2
m=i++&&j++&&k++(C1)||n++(C2);
THEN C1 IS 0 and c2 is 0++ is 1 so true.
so answer is
1,same,same,0,i,

Is This Answer Correct ?    4 Yes 4 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / saravanan

0,1,2,0

Is This Answer Correct ?    0 Yes 0 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / kishore krishnan.s.r

Its actually a doubt
Since ++ has high precidence than && will it not be evaluated first.
then ans will be 1,2,3,0,1

Is This Answer Correct ?    0 Yes 1 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / musa

1,2,3,1,1

Is This Answer Correct ?    2 Yes 4 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / deepshree sinha

i=1,j=2,k=3,m=0,n=1

Is This Answer Correct ?    7 Yes 11 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / navin jaiswal

1 2 3 1 0

Is This Answer Correct ?    1 Yes 6 No

#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||..

Answer / abc

1 1 2 0 0

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More C Interview Questions

What does return 1 means in c?

0 Answers  


void main() { int x=25,y=32; clrscr(); x=x++ + y++; y=++x + ++y; printf("%d%d",x,y); }

5 Answers  


What is a method in c?

0 Answers  


Please write the area of a RIGHT ANGLED TRIANGLE.

1 Answers  


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

0 Answers  






A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

0 Answers  


can anyone suggest some site name..where i can get some good data structure puzzles???

0 Answers  


how does the C compiler interpret the following two statements p=p+x; q=q+y; a. p=p+x; q=q+y b. p=p+xq=q+y c. p=p+xq; q=q+y d. p=p+x/q=q+y

2 Answers   TCS, Tech Synergy,


What is a stream?

0 Answers  


Is there any data type in c with variable size?

0 Answers  


What are the differences between Structures and Arrays?

0 Answers   TCS,


What is the correct declaration of main?

0 Answers  


Categories