-
Notifications
You must be signed in to change notification settings - Fork 25
/
C++program
37 lines (37 loc) · 977 Bytes
/
C++program
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
#include <iostream>
using namespace std;
int main ()
{
int i,j,digits,min,max,average;
!Creates a four by four table by the input of the user and gives which number is the maximum, the minimum and what's the average score
float a[4];
min=10;
max=0;
average=0;
for (i=0; i<4; i++)
{
cout<<"Give the value of the table"<<endl;
cin>>a[i];
}
for (i=0; i<4; i++)
{
cout<<"This part of the table has the value of"<<a[i]<<endl;
}
for (i=0; i<4; i++)
{
if (a[i]<min)
min=a[i];
else if (a[i]>max)
max=a[i];
else if (a[i]>5)
{
average=average+a[i];
digits++;
}
}
average=average/digits;
cout<<"O mesos oros twn psifiwn pano tou 5 einai "<<mo<<endl;
cout<<"The maximum number is"<<max<<endl;
cout<<"The minimum number is"<<min<<endl;
cout<<"The maximum number is in the position "<<&max<<endl;
}