blob: 927750da0f43a87c75b4f5d50ade8ce33bec9e0a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
This file contains all work not applicable to being answered in code/output form.
6.4 Exercises #1:
0
2
3
3
2
7.1 Exercises #1-6:
1) Wrong syntax - should be: int_exp1 >= int_exp2
2) Not a conditional - should be: int_exp1 == int_exp2 (unless you wanted an assignemnt)
3) Wrong syntax - should be: int_exp1 != int_exp2
4) "A" is a string, will always evaluate to false - should be: char_exp == 'A'
5) Mismatched data type - should be: int_exp1 > 66 for clarity (66 is the decimal value of 'B'), although it should work
6 Wrong syntax - should be: (int_exp1 < 2) && (int_exp1 > -10)
6.5 Exercises #1-5:
1) a += 25
2) b *= (a * 2)
3) b++
4) c %= 5
5) b /= a
|