Solution for Exercise 8-2
ex0802
#include <stdio.h> int main() { int a,b; a = 6; b = a + 2; if( a > b) { printf("%d is greater than %d\n",a,b); } return(0); }
Output
(None.)
Notes
* No, you did nothing wrong. The program doesn't generate any output. Can you explain why before reading the next bullet point?
* Look at the code!
* Because the value of variable a
is not greater than the value of variable b
, no output is generated. The statement in the curly brackets isn't executed because the if condition is false. Keep reading in the book for more information.
Copyright © 1997-2024 by QPBC.
All rights reserved