Finding the biggest of 3 numbers using if...else
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int a, b, c;
clrscr();
printf("Enter three numbers : ");
scanf("%d %d %d", &a, &b, &c);
if(a > b)
{
if(a > c)
printf("\n%d is the biggest number", a);
else
printf("\n%d is the biggest number", c);
}
else
{
if(c > b)
printf("\n%d is the biggest number", c);
else
printf("\n%d is the biggest number", b);
}
getch();
}
Output:
Enter three numbers : 10 20 30
30 is the biggest number
-
UpdatedDec 30, 2019
-
Views7,591
You May Like
Program to maintain employee details using structures
Program to maintain student details using structures
Check whether the person is eligible to vote or not
Print the numbers that are divisible by a given no.
Program to generate magic square
To sort the given numbers in ascending & descending order