C
Programming and Technical
Programming
Arrays
int i=3,j=2,k=0,m;
m = ++i && ++j || ++k;
printf(ā%d %d %d %dā, i , j, k,m);
Read Solution (Total 2)
-
- ++i=4(binary equivalent=100)
++j=3(binary equivalent =011)
++k=1(binary equivalent=001)
now
100&&011||001=001(which is nothing but 1) - 3 years agoHelpfull: Yes(0) No(0)
- ++i , ++j,++k are pre incrment i.e the value is incrmented by 1 before executing
now m=++i&&++j||++k i.e m=4&&3||1
whenever && is used it will check if the both operand are non zero .if yes then it returns true ie 1
and || is used it will check if one of the operand is non zero it returns 1
so herby m=1
the answer will be 4,3,1,1 - 5 Months agoHelpfull: Yes(0) No(0)
C Other Question