C Program To Find Greater of Two Numbers

PROGRAM :

#include<stdio.h>
int main()
{
    int a,b;
    printf("Enter two number to find which one is greater \n");
    scanf("%d%d",&a,&b);
    if(a>b)
    printf("\n%d is greater than %d \n",a,b);
    else if(a<b)
    printf("\n%d is greater than %d \n",b,a);
    else
    printf("\n%d is equal to %d \n",a,b);
}




OUTPUT :

Enter two number to find which one is greater
3
1

3 is greater than 2

Post a Comment

0 Comments