Programming Exercises 385
- Write the following Java for statement in Ada:
int i, j, n = 100;
for (i = 0, j = 17; i < n; i++, j--)
sum += i * j + 3;
- Rewrite the C program segment of Programming Exercise 4 using if
and goto statements in C. - Rewrite the C program segment of Programming Exercise 4 in Java
without using a switch statement. - Translate the following call to Scheme’s COND to C and set the resulting
value to y.
(COND
((> x 10) x)
((< x 5) (* 2 x))
((= x 7) (+ x 10))
)