This task is a mixed text/programming task. You need to update the content of loop.cpp according to the instruction provided in the file. For the code part, please check the autograder output.
Task
Considering the snippet
for (;;) {
int i1, i2;
std::cin >> i1 >> i2;
std::cout << i1 + i2 << "\n";
int again;
std::cout << "Again? (0/1)\n";
std::cin >> again;
if (again == 0) break;
}
-
Describe what it computes.
-
Decide which of the other two kind of loops would fit better than the one it is currently using, and describe why.
-
Rewrite the snippet into the loop you specified in (2). This part is autograded. Note: print the control message "Again? (0/1)" using the same format used in the snippet.