-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmark.cpp
More file actions
65 lines (49 loc) · 1.15 KB
/
mark.cpp
File metadata and controls
65 lines (49 loc) · 1.15 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include <string>
using namespace std;
int main(){
int const numberMarks = 7;
double marks[numberMarks];
marks[0] = 13;
marks[1] = 9.5;
marks[2] = 17.23;
marks[3] = 16;
marks[4] = 8;
marks[5] = 18.7;
marks[6] = 10;
double total = 0;
for(int i = 0; i < numberMarks; i++)
{
total += marks[i];
}
total /= numberMarks;
cout << "the result is : " << total << "/20" << endl;
//------------------------------------------------------------------------------//
int const seiz = 5;
int table[seiz];
for(int i = 0; i < seiz; i++)
{
cout << "input a number : ";
cin >> table[i];
}
cout << endl;
for(int j = 0; j < seiz; j++)
{
cout << table[j] << endl;
}
cout << endl;
for (int k = 0; k < seiz; k++)
{
if(table[k] %2 == 0)
{
table[k] = 0;
cout << table[k] << endl;
}else
{
cout << table[k] << endl;
}
}
cout << endl;
//------------------------------------------------------------------------------//
return 0;
}