I am having a little problem with a logic evaluation of a simple expression,
perhaps I need a nudge in the right direction:
Given an assignment x = 9,
I am trying to evaluate the following - (x%2==0) and (x%3==0).
The output gives
as in
(x ==0) is evaluated as : 0
and
(x ==0) is evaluated as : 1
Looks strange to me, probably needs some explanation if correct
Thanks!
Actual Code:
Code:
/*Q8.4.C: Evaluating an operand */
#include <stdio.h>
main()
{
int x;
x = 9;
printf("Given x = 9, \n");
printf("(x%2==0) is evaluated as : %i \n ", (x%2==0) );
printf("and \n");
printf("(x%3==0) is evaluated as : %i \n ", (x%3==0) );
return 0;
}