Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2. False, true, false, true, false, true, true, true.
- 4.Yes
- 6.Yes
- 8.If, else if, else
- 10.1
- 12. Inside true block
- End of sequence
- 14. String is not hello
- End of sequence
- 16. Hello 3
- Hello 4
- Done
- 18. letter 2
- 20. if(a){
- b+=2;
- }
- else{
- b—-;
- 22. if(a){
- a = false;
- }
- else{
- a = true;
- }
- 24. if(b<c)
- b++;
- 26. if(c!=0)
- b=b/c;
- 28. if(a && b>10)
- c++;
- 30. if(b > 5 || c > 5){
- a = true;
- }
- else{
- a = false;
- }
- 32. AND should be written as &&.
- 34. Parenthesis should surround b1 after the if statement and curly brackets should surround the operation to be performed.
- 36. else should come after else if otherwise else if won't be performed.
- 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.
- 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