Solution for Exercise 8-11
ex0811
#include <stdio.h>
int main()
{
int a,b;
a = 6;
printf("Type a value: ");
scanf("%d",&b);
if( a > b)
{
printf("%d is greater than %d\n",a,b);
}
else
{
printf("%d is not greater than %d\n",a,b);
}
return(0);
}
Output
Type a value: 800
6 is not greater than 800
Notes
* The number 800 was input for the sample run shown above.
* The printf() and scanf() functions at Lines 8 and 9 should be familiar to you. I hope you remembered to specify the & before the b variable at Line 9.
Copyright © 1997-2025 by QPBC.
All rights reserved
