Explore a little.C ProgrammingC++HTMLVisual BasicSystem AnalysisE-CommerceBCA Notes
LEARN SOMETHING NEW

C Program to Find the Largest Number Among Three Numbers

Read4BCA learning libraryFree access

C Program to Find the Largest Number Among Three Numbers

//C Program to Find the Largest Number Among Three Numbers
//Header Files
#include<stdio.h>
#include<conio.h>

void main()
{

int n1, n2, n3;
clrscr();
printf("Enter three different numbers: ");
scanf("%d %d %d", &n1, &n2, &n3);
if( n1>=n2 && n1>=n3 )
{

printf("%d is the largest number.", n1);

}
else if( n2>=n1 && n2>=n3 )
{

printf("%d is the largest number.", n2);

}
else
{

printf("%d is the largest number.", n3);

}
getch();

}

Output

C Program to Find the Largest Number Among Three Numbers example

You can also see a video how to run this program

This lesson preserves the original Read4BCA material. Some programming examples use older tools and syntax. View original page.