Ask your own question, for FREE!
Mathematics 19 Online
OpenStudy (anonymous):

please can anyone help with a computer science problem (c++)........Write a loop that produces the output below (hint: each number in the right column is the sum of all values in the left column up to the point): I sum 0 0 1 1 2 3 3 6 4 10 5 15 6 21

OpenStudy (across):

#include <iostream> using namespace std; int main() { int sum = 0; cout << "I sum\n"; for (int i = 0; i <= 6; i++) { sum += i; cout << i << " " << sum << endl; } cin.get(); return 0; }

OpenStudy (anonymous):

thank you so much "across", really appreciate it

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!