Solution for Exercise 8-5

ex0805

#include <stdio.h>

int main()
{
    int first,second;

    printf("Input the first value: ");
    scanf("%d",&first);
    printf("Input the second value: ");
    scanf("%d",&second);

    puts("Evaluating...");
    if(first<second)
    {
        printf("%d is less than %d\n",first,second);
    }
    if(first>second)
    {
        printf("%d is greater than %d\n",first,second);
    }
    if(first==second)
    {
        printf("%d is equal to %d\n",first,second);
    }
    return(0);
}

Notes

* Two equal signs are used for comparison.

* When you see ==, say "is equal to."

* You do not use == to compare strings.