Skip to content

Commit 1734e2c

Browse files
authored
BiggestNo
C Program to Find the Biggest of 3 Numbers
1 parent c5c05c2 commit 1734e2c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

biggestno

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* C program to find the biggest of three numbers
3+
*/
4+
#include <stdio.h>
5+
6+
void main()
7+
{
8+
int num1, num2, num3;
9+
10+
printf("Enter the values of num1, num2 and num3\n");
11+
scanf("%d %d %d", &num1, &num2, &num3);
12+
printf("num1 = %d\tnum2 = %d\tnum3 = %d\n", num1, num2, num3);
13+
if (num1 > num2)
14+
{
15+
if (num1 > num3)
16+
{
17+
printf("num1 is the greatest among three \n");
18+
}
19+
else
20+
{
21+
printf("num3 is the greatest among three \n");
22+
}
23+
}
24+
else if (num2 > num3)
25+
printf("num2 is the greatest among three \n");
26+
else
27+
printf("num3 is the greatest among three \n");
28+
}

0 commit comments

Comments
 (0)