-
Notifications
You must be signed in to change notification settings - Fork 16
/
2.c
40 lines (33 loc) · 855 Bytes
/
2.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
#include <stdio.h>
int main()
{
int i, j;
float max_temp, min_temp;
float temperatures[31][10];
printf("Enter Temperature Records: \n");
for (i = 0; i < 31; i++)
{
for (j = 0; j < 10; j++)
{
scanf("%f", &temperatures[i][j]);
}
}
max_temp = min_temp = temperatures[0][0];
for (i = 0; i < 31; i++)
{
for (j = 0; j < 10; j++)
{
if (max_temp < temperatures[i][j])
{
max_temp = temperatures[i][j];
}
if (min_temp > temperatures[i][j])
{
min_temp = temperatures[i][j];
}
}
}
printf("The Highest Temperature: %0.2f\n", max_temp);
printf("The Lowest Temperature: %0.2f\n", min_temp);
return 0;
}