Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Arithmetic Worksheet For each of the following assignment statements, show the value that will be stored in the variable on the left hand side. Assume
Arithmetic Worksheet For each of the following assignment statements, show the value that will be stored in the variable on the left hand side. Assume that you are given the following declarations: int num; float val; 1. num = 17 / 2 + 4; 2. val = 17 / 2 + 4; 3. num = 17 / 2.0 + 4; 4. val = 17 / 2.0 + 4; 5. num = 11 % 6 / 2 - 1; 6. val = 11 % 6 / 2.0 - 1; 7. num = 3 - (5 + 10 / (2 * 2)); 8. val = 3 - (5 + 10 / (2 * 3.0)); 9. val = 4.5 * (5 - 3); num = val; 10. num = 15 / 2 % 3 - 1; 11. num = 7 * 2 - 5 / 3; val = num; Assume that total, num1, and num2 are int variables, with total = 2, num1 = 3, and num2 = 4. Show the new values of all variables changed by each of the following: 12. total = ++num1; 13. total = num2++; 14. total *= 5; 15. total += num1 - num2 * 4; 16. total = ++num1 + num2++; 17. total += 3 * num1++ - 5;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started