Integer:2
Cumulative product:2
Integer: 4
Cumulative product: 8
Integer: 6
Cumulative multiplication:48
I'm trying to print it out, but I don't know how to code it Please help me
python
I made it simple. c++
#include <iostream>
using namespace std;
int main() {
int* arr = new int[3]{1,1,1};
int temp = 1;
for (int i = 0;i < 3;i++) {
cout << "integer:";
cin >> arr[i];
for (int j = 0;j < 3;j++) {
temp *= arr[j];
}
cout << "Cumulative product:" <<temp << endl;
temp = 1;
}
}
© 2024 OneMinuteCode. All rights reserved.