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...

Which type of network device is used to create a virtual local area network?

A. A router B. A network concentrator C. A switch D. NIC cards in promiscuous mode

Computer Science & Information Technology

Which of the following fire extinguisher types is used for wood and paper fires?

A) Class A B) Class B C) Class C D) Class D

Computer Science & Information Technology