Skip to content

Commit 5a5534e

Browse files
author
Kirtan4939
authored
Greaternumber
Program to find greatest number among two numbers
1 parent c5c05c2 commit 5a5534e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Greaternumber

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
int main(void)
2+
3+
{
4+
5+
6+
int num1,num2;
7+
8+
printf("Enter two numbers:");
9+
scanf("%d %d",&num1,&num2);
10+
11+
12+
if(num1>num2)
13+
14+
15+
{
16+
17+
printf("%d is greatest",num1);
18+
19+
20+
}
21+
22+
23+
else if(num2>num1)
24+
25+
26+
{
27+
28+
29+
printf("%d is greatest",num2);
30+
31+
32+
}
33+
34+
35+
else
36+
37+
38+
{
39+
40+
41+
printf("%d and %d are equal",num1,num2);
42+
43+
44+
}
45+
46+
47+
return 0;
48+
49+
50+
}

0 commit comments

Comments
 (0)