{
int i, j, k;
i = -1;
j = 1;
k = 1;
++i && j++ || ++k;
printf(“%d %d %d\n”,i,j,k);
return 0;
{
int i, j, k;
i = -1;
j = 1;
k = 1;
++i && j++ || ++k;
printf(“%d %d %d\n”,i,j,k);
return 0;
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
0,1 and -1
in and operator both condition must be satisfied
but in case of or operator if any one condition is true it doesnot check the second
condition.
implemented client server project using sockets
done client server project using sockets…
Hi
In AND logic operation if statement A is false then the compiler will not check the statement B. However, if statement A is true then the compiler will check the condition of statement B.
In OR operation if statement A is true then the compiler will not check the statement B. However, if statement A is false then it will check the statement B.
In the above problem when i is incremented the value is 0 hence it won’t check the condition for j however the result of AND operation will be checked with K in OR condition. Hence the value of i: 0, j: 1 and k: 2
thanku sir