-
Notifications
You must be signed in to change notification settings - Fork 16
/
12.c
43 lines (43 loc) · 895 Bytes
/
12.c
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
#include <stdio.h>
int main()
{
int a, b, c, sum, large, small;
float average;
printf("ID:2102020\n");
printf("Enter Three Numbers: ");
scanf("%d %d %d", &a, &b, &c);
sum = a + b + c;
printf("The Sum of Three Values: %d\n", sum);
average = (a + b + c) / 3.0;
printf("The Average of Three Values: %f\n", average);
if (a > b)
{
if (a > c)
large = a;
else
large = c;
}
else
{
if (b > c)
large = b;
else
large = c;
}
printf("The Largest Number: %d\n", large);
if (a < b)
{
if (a < c)
small = a;
else
small = c;
}
else
{
if (b < c)
small = b;
else
small = c;
}
printf("The Smallest Number: %d\n", small);
}