-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassign5.9.5.cpp
More file actions
40 lines (34 loc) · 771 Bytes
/
assign5.9.5.cpp
File metadata and controls
40 lines (34 loc) · 771 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
#include <iostream>
#include <string.h>
int main()
{
const char* months[12] = {
"January",
"Febuary",
"March",
"April",
"May",
"June",
"July",
"Auguest",
"September",
"October",
"November",
"December"
};
int sales[12];
int sum = 0;
for (int i = 0; i < 12; ++i)
{
std::cout << "Enter " << months[i] << " sales: ";
std::cin >> sales[i];
sum += sales[i];
}
std::cout << "Sales of the whole year: " << sum << std::endl;
std::cout << "Month" << " " << "Sales" << std::endl;
for (int j = 0; j < 12; ++j)
{
std::cout << months[j] << " " << sales[j] << std::endl;
}
return 0;
}