Q:

C Program to find largest number among three numbers

0

Write a C Program to find largest number among three numbers. Here’s simple Program to find largest number among three numbers in C Programming Language.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Below is the source code for C Program to find largest number among three numbers which is successfully compiled and run on Windows System to produce desired output as shown below :

SOURCE CODE : :

/*  C Program to find largest number among three numbers  */

#include <stdio.h>

int main()
{
    int a,b,c;
    int largest;

    printf("Enter first number :: ");
    scanf("%d",&a);
    printf("\nEnter Second number :: ");
    scanf("%d",&b);
    printf("\nEnter third number :: ");
    scanf("%d",&c);

    if(a>b && a>c)
        largest=a;
    else if(b>a && b>c)
        largest=b;
    else
        largest=c;

    printf("\nLargest number is = %d \n",largest);

    return 0;
}

OUTPUT : :

Enter first number :: 4

Enter Second number :: 5

Enter third number :: 2

Largest number is = 5

Above is the source code for C Program to calculate largest number among three numbers which is successfully compiled and run on Windows System.The Output of the program is shown above .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Number Solved Programs – C Programming

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C Program to display sum of even and product of od... >>
<< Write a C Program to check whether number is EVEN ...