Write single C++ statements or portions of statements that do the following:

a) Input unsigned int variable x with cin and >>.
b) Input unsigned int variable y with cin and >>.
c) Declare unsigned int variable i and initialize it to 1.
d) Declare unsigned int variable power and initialize it to 1.
e) Multiply variable power by x and assign the result to power.
f) Preincrement variable i by 1.
g) Determine whether i is less than or equal to y.
h) Output integer variable power with cout and <<.

```
a) cin >> x;
b) cin >> y;
c) unsigned int i{1};
d) unsigned int power{1};
e) power *= x;
or
power = power * x;
f) ++i;
g) if (i <= y)
h) cout << power << endl;
```

Computer Science & Information Technology

You might also like to view...

In a PowerPoint presentation, the ____ tab on the Ribbon contains commands to alter font type, size, and color, just as with a Word document or an Excel workbook.

A. Format B. Home C. Themes D. Layout

Computer Science & Information Technology

When you delete files from a(n) ____,  they do not go to the Recycle Bin.

A. USB flash drive B. hard drive C. folder D. list

Computer Science & Information Technology