include <stdio.h>int main(void) { int i=4,j=1,k=0,w,x,y,z; w=i||j||k; x=i&&j&&k; y=i||j&&k; z=i&&j||k; printf("w=%d x=%d y=%d z=%d\n",w,x,y,z); return 0; } asked 15 Sep '17, 14:21 ![]()
|
Please use sites like ideone to keep a good format to the code. For now its quite a small code so its readable. answered 15 Sep '17, 19:26 ![]()
|
If the value of j=-1, then also you will get same answer. The thing matters here is, value 0. Any non-zero value will be equivalent Boolean 1. So -1 also implies Boolean 1. answered 16 Sep '17, 12:51 ![]()
|