C Program to print the largest number among two numbers

#include<stdio.h>
int main()
{
    int firstnum,secondnum;
    printf("Enter the first number\n");
    scanf("%d",&firstnum);
    printf("Enter the second number\n");
    scanf("%d",&secondnum);
    if(firstnum>secondnum)
        printf("%d is greater than %d ",firstnum,secondnum);
    else
        printf("%d is greater than %d ",secondnum,firstnum);

}

Output:






Comments