0% found this document useful (0 votes)
2 views1 page

Largest of Three Numbers in C

The document provides a C program that finds the largest among three numbers using if-else statements. It prompts the user to enter three integers, compares them, and outputs the largest number. An example input and output are included to demonstrate the program's functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Largest of Three Numbers in C

The document provides a C program that finds the largest among three numbers using if-else statements. It prompts the user to enter three integers, compares them, and outputs the largest number. An example input and output are included to demonstrate the program's functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Program 2: Find the largest among three

numbers using if-else in c language


#include <stdio.h>
int main() {
int a, b, c, largest;
printf("Enter three numbers: ");
scanf("%d %d %d", &a, &b, &c);
if (a >= b && a >= c)
largest = a;
else if (b >= a && b >= c)
largest = b;
else
largest = c;
printf("Largest number = %d\n", largest);
return 0;
}
Output:
Enter three numbers: 5 2 3
Largest number = 5

You might also like