Program to find greater number between two number in C-language

Program to find greater number between two number in C-language

 #include<stdio.h>
int main()
{
    int a,b;
    printf("Enter first number\n");
    scanf("%d",&a);
    printf("Enter second number\n");
    scanf("%d",&b);
    if(a>b)
    {
        printf("Greatest number=%d",a);
    }
    else
    {
        if(b>a)
        {
            printf("Greatest number=%d",b);
        }
        else
        {
            printf("Both number are equal");
        }
    }
}

OUTPUT
Enter first number
8
Enter second number
9
Greatest number=9

Visit Homepage

Comments

Popular posts

Creative pattern of butterfly in C-language

Program to show present time and date in C-language

Introduction of C-language.

Program to cheque enter number is a perfect number or not using if else in C-language

Program to cheque four digits number is palindrome or not in C-language

Program to print the cube of a number in c-language

Simple Hello world program in c- language