Answer the following statements true (T) or false (F)
1. Program readability can be improved by indenting both the true and false tasks of all if-else statements.
2. An algorithm should be carefully hand traced before it is implemented in C.
3. If the value of control is 5, the following switch statement will cause a run-time error.
```
switch (control) {
case 1:
printf("one");
break;
case 2:
printf("two");
break;
case 3:
printf("three");
break;
case 4:
printf("four");
}
```
4. The statements on the left always give p the same value as the code on the right, but the code on the right may execute faster.
```
if (x > 15) if (x > 15)
p = p * x; p = p * x;
if (x > 30) else if (x > 30)
p = 2 * p * x; p = 2 * p * x;
```
5. C accepts any nonzero value as true.
1. True
2. True
3. False
4. False
5. True
You might also like to view...
A(n) ____ variable type is used to store logical (true or false) values.
A. Boolean B. Binary C. Object D. String
Initial exchanges of public keys are vulnerable to the man-in-the-middle attack. Describe as many defences against it as you can.
What will be an ideal response?
____ methods pass the data stored in a field back to a client program.
A. Mutator B. Send C. Set D. Get
Describe image compositing. Describe composition in design.
What will be an ideal response?