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);
}

Notes

* 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.