Bhuvan InfoTech Android App

Download our Android App and browse Technical News, Projects, Computer Tricks more easily with lots of Interesting Features.

Tuesday, June 14, 2016

Largest among 3 variables using nested if | C program

#include <stdio.h>
int main()
{
    int a,b,c;
    printf("Enter three numbers: \n");
    scanf("%d %d %d",&a,&b,&c);
    if(a>=b)
    {
        if(a>=c)
            printf("%d is greater",a);
        else
            printf("%d is greater",c);
    }
    else if(b>=c)
        printf("%d is greater",b);
    else
        printf("%d is greater",c);
    return 0; 
}
Bhuvan Arora

No comments:

Amazing Deal !