Find largest amongst three numbers - C Program

C program to read 3 different numbers and find largest amongst them.

Solution:

#include <stdio.h>
int main()
{
     int n1, n2, n3, large;
     printf("\tEnter Three Numbers\n");
     printf("--------------------------------\n");
     printf("Enter First Number  : ");
     scanf("%d", &n1);
     printf("\nEnter Second Number : ");
     scanf("%d",&n2);
     printf("\nEnter Third Number  : ");
     scanf("%d",&n3);
     printf("--------------------------------\n");
     if((n1>n2) && (n1>n3))
     {
          large = n1;
     }
     else if(n2>n3)
     {
          large = n2;
     }
     else
     {
          large = n3;
     }
     printf("Largest Number = %d\n", large);
     return 0;
}


Output:

largest among three