C Program for Largest Among Three Numbers

In this program, you'll learn to print largest among three numbers.



Source Code
#include<stdio.h>

int main()
{
    int a, b, c;
    printf("Enter value of three variables: ");
    scanf("%d%d%d", &a, &b, &c);

    if(a > b)
    {
        if(a > c)
            printf("a is greater");
        else
            printf("c is greater");
    }
    else
    {
        if(b > c)
            printf("b is greater");
        else
            printf("c is greater");
    }
    return 0;
}
Output
Enter value of three variables: 
45 
81 
24
b is greater