More on expressions
You can use any valid C expression as argument to if
Keep in mind that any positive number is TRUE and zero is FALSE (negative number may give strange results)
int b;
b=rand();
if(b)
printf(“Got %d\n”,b);
else
printf(“Got 0!\n”);
Previous slide
Next slide
Back to first slide
View graphic version