-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMax3.c
More file actions
45 lines (44 loc) · 878 Bytes
/
Max3.c
File metadata and controls
45 lines (44 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<stdio.h>
int greatest(int a ,int b, int c)
{
if(a > b)
{
if(c > a)
{
printf("Third number is the greatest!");
}
else
printf("First is the greatest!");
}
if(b > c)
{
if(a > b)
{
printf("I is the greatest!");
}
else
printf("II is the greatest!");
}
if(c > a)
{
if(b > c)
{
printf("B is greatest");
}
else
printf("C is greatest");
}
}
int main()
{
int x ,y, z;
printf("Welcome to the greatest of the three number problem!");
printf("Enter the first number = ");
scanf("%d",&x);
printf("Enter the second number = ");
scanf("%d",&y);
printf("Enter the third number = ");
scanf("%d",&z);
greatest(x, y, z);
return 0;
}