Write C++ statement to accomplish each of the following: Assign the sum of x and y to z and increment the value of x by 1 after the calculation. Test if the value of the variable count is greater than 10. If it is, print "count is greater than 10." Decrement the variable x by 1 then subtract it from the variable total. Calculate the remainder after q is divided by divisor and assign the result to q. Write this statement two different ways.
Solution
- z = x++ + y;
- if( count > 10 )
cout << "Count is greater than 10." << endl;
- total -= --x;
- q %= divisor;
If You Enjoyed This, Take 5 Seconds To Share It
0 Questions:
Post a Comment