Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
#include <iostream> using namespace std; int main() { int i = 1; while(i <= 10) { int sum = 0; sum = sum + i; } cout << sum << endl; return 0; }a. Why doesn't this program compile? (Note: explain why it doesn't compile as is, not how to fix it!) b. Annotate the code to show how to fix it so that it works properly.
int
s,
along with
the number of terms in the product. An example run of your
program might look like this (with the user input in red):
Please enter a product to be computed, followed by an = sign. : 4 * 56 * 2 * 7 * 4 = The product of the 5 numbers entered is 12544 |
111 * 222 * 333 * 444 * 555 * 666 =What's strange about this answer, and what do you think happened?
4 * 56 * 2 * 7 * 4 =