My homework asks "What is the output of the following?" and i'm thinking something is horribly wrong with this code or they skipped this in class.
the only thing vaguely tickling my brain is the true/false (1 or 0) thing. but if that's so, i didn't realize you could assign 1 or 0 to integers using true / false tests.
int main()
{
int a = 3, b = -1, c = 0, i, j, k, n;
i = a || b || c;
j = a && b && c;
k = a || b && c;
n = a && !(b || c);
printf("\ni = %d, j = %d, k = $d, n = %d\n", i, j, k, n);
}
2007-08-09
09:54:25
·
5 answers
·
asked by
Julia D
3
in
Programming & Design