All pastes #2047383 Raw Edit

Untitled

public text v1 · immutable
#2047383 ·published 2011-04-17 08:08 UTC
rendered paste body
#include <stdio.h>
int sum(int,int);
//This is my first test program. It will be silly.
int main(void)
    {
        int x;
        int y;
        int a;
        int b;
        int sum1;
        int sum2;

        printf("This program will take two sums taken from \n two numbers each and compare them. \n");

        printf("Enter a number: ");
        scanf("%d", &x);

        printf("Enter a number: ");
        scanf("%d", &y);

        printf("Enter a number: ");
        scanf("%d", &a);

        printf("Enter a number: ");
        scanf("%d", &b);

        sum1 = sum(x,y);
        sum2 = a + b;

        if (sum1 > sum2)
        {
            printf("%d plus %d is greater than %d plus %d",x,y,a,b);
        }
        if (sum1 == sum2)
        {
            printf("%d plus %d is equal to %d plus %d",x,y,a,b);
        }
        if (sum1 < sum2)
        {
            printf("%d plus %d is less than %d plus %d",x,y,a,b);
        }
    return 0;
    }