Advertisement
Arush22

5.14 problems 2-40 EVEN

Mar 6th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. 2. False, true, false, true, false, true, true, true.
  2. 4.Yes
  3. 6.Yes
  4. 8.If, else if, else
  5. 10.1
  6. 12. Inside true block
  7. End of sequence
  8. 14. String is not hello
  9. End of sequence
  10. 16. Hello 3
  11. Hello 4
  12. Done
  13. 18. letter 2
  14. 20. if(a){
  15. b+=2;
  16. }
  17. else{
  18. b—-;
  19. 22. if(a){
  20. a = false;
  21. }
  22. else{
  23. a = true;
  24. }
  25. 24. if(b<c)
  26. b++;
  27. 26. if(c!=0)
  28. b=b/c;
  29. 28. if(a && b>10)
  30. c++;
  31. 30. if(b > 5 || c > 5){
  32. a = true;
  33. }
  34. else{
  35. a = false;
  36. }
  37. 32. AND should be written as &&.
  38. 34. Parenthesis should surround b1 after the if statement and curly brackets should surround the operation to be performed.
  39. 36. else should come after else if otherwise else if won't be performed.
  40. 38. Because the if tests a value and the else if compares a different two values it is possible for both to be true but the else if will never execute even if its true, if the if statement is true.
  41. 40. The value of a is being set to 31 rather than being compared to it. Replace "=" with "==";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement