Skip to content

Commit 25ddb4f

Browse files
authoredOct 2, 2020
GreaterNumber
Program to find greatest of two numbers in C
1 parent 16f6eab commit 25ddb4f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 

‎GreaterNumber

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* C Program to Find Largest of Two numbers */
2+
3+
#include <stdio.h>
4+
5+
int main() {
6+
int a, b;
7+
printf("Please Enter Two different values\n");
8+
scanf("%d %d", &a, &b);
9+
10+
if(a > b)
11+
{
12+
printf("%d is Largest\n", a);
13+
}
14+
else if (b > a)
15+
{
16+
printf("%d is Largest\n", b);
17+
}
18+
else
19+
{
20+
printf("Both are Equal\n");
21+
}
22+
23+
return 0;
24+
}

0 commit comments

Comments
 (0)
Please sign in to comment.