Write C++ statements to accomplish each of the following:

a) In one statement, assign the sum of the current value of x and y to z and postincrement the value of x.
b) Determine whether the value of the variable count is greater than 10. If it is, print"Count is greater than 10."
c) Predecrement the variable x by 1, then subtract it from the variable total.
d) Calculate the remainder after q is divided by divisor and assign the result to q. Write this statement two different ways.


a) z = x++ + y;
b) if ( count > 10 )
cout << "Count is greater than 10" << endl;
c) total -= --x;
d) q %= divisor;
q = q % divisor;

Computer Science & Information Technology

You might also like to view...

The mouse pointer changes to a(n) ________ once a shape is about to be "drawn" on a slide

A) arrow B) pointing finger C) star D) black cross

Computer Science & Information Technology

A bar chart uses ________ bars

Fill in the blank(s) with correct word

Computer Science & Information Technology

A vector graphic neither can be edited with the brush or eraser tools, nor can it be filled with color using the ____________________ Tool.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The term ___________ typically refers to the device that displays console output.

a. Standard output device b. Central processing unit c. Secondary storage device d. Liquid crystal display

Computer Science & Information Technology