Solution for Exercise 8-3
ex0803
#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); }
Notes
* It's customary to indent the sole statement belonging to if, but it's not required. Sometimes, especially when the statement is short, they're both combined on the same line:
* For readability sake, and until you have a lot of coding under your belt, I recommend keeping the statements separate. Further, I recommend using the curly braces until you're comfortable knowing when they're required and when they're optional.
Copyright © 1997-2024 by QPBC.
All rights reserved