Home›Community›WAC to find the largest of 3 nos. using if else , take inpu…
WAC to find the largest of 3 nos. using if else , take input from user.
Soham •
Jul 17, 2026 •
14 views
0
1 Answers
Soham
Jul 17, 2026
#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter three numbers: ");
scanf("%d %d %d", &a, &b, &c);
if (a >= b && a >= c)
{
printf("%d is the largest number.", a);
}
else if (b >= a && b >= c)
{
printf("%d is the largest number.", b);
}
else
{
printf("%d is the largest number.", c);
}