Solution for Exercise 6-9
ex0609
#include <stdio.h> int main() { int shadrach=701; int meshach=709; int abednego=719; printf("Shadrach is %d\nMeshach is %d\nAbednego is %d\n",\ shadrach,meshach,abednego); return(0); }
Output
Shadrach is 701
Meshach is 709
Abednego is 719
Notes
* You can also specify the variables and assign them values on the same line, shown in the second possible solution here:
#include <stdio.h> int main() { int shadrach=701,meshach=709,abednego=719; printf("Shadrach is %d\nMeshach is %d\nAbednego is %d\n",\ shadrach,meshach,abednego); return(0); }
* Granted, this presentation doesn't make the code as readable as it could. I believe the second example from Exercise 6-7 on this website presents the code in the most readable manner.
Copyright © 1997-2024 by QPBC.
All rights reserved