diff --git a/profit_6_months.cpp b/profit_6_months.cpp new file mode 100644 index 0000000..b901bd5 --- /dev/null +++ b/profit_6_months.cpp @@ -0,0 +1,27 @@ +#include +#include +using namespace std; + +int main() { + setlocale(0, ""); + const int n = 6; + srand(time(0)); + + double arr[n] = { 0 }; + double sum = 0; + + cout << "Input your profit values every month\n"; + for (int i = 0; i < n; ++i) { + cout << "Month " << i + 1 << ": "; + cin >> arr[i]; + } + + for (int i = 0; i < n; ++i) { + sum += arr[i]; + } + + cout << "Your summary profit is " << sum << endl; + + return 0; +} +