Answers To Debugging Exercises Chap 2
Answers To Debugging Exercises Chap 2
1. a = ‐28
b = ‐31
2. a = 68
3. a =0
5. 0
1
1
1
6. 10 + a / 4 * b = 35
c / d * b + a – b = 20
7. The program will show garbage values as a and b are not initialized.
8. 70
9. n = 0
10. c = 33.00000
11. a = 3 b = 4
12. 0
13. a = 9
14. 4 9 0
16. 3 1 7
19. x = 12 y = 22 RESULT = 64
20. x = 11 y = 20 RESULT = 30
21. 0
0.666667
2
22. 16
23. 0
24. n =2
25. c=2d=4
26. _ = 30
28.
a*b=6
a/b=0
a%b=2
a && b = 2
29. a= 0
30. a=0
31.
num = 56
num = 70
num = 38
4. lvalue required. Increment operator cannot be applied to a numeric constant. It can be applied on
variable