Homework Assignment 3 Solutions
Solutions:
- Write a program which inputs two integers and prints
the larger of the two.
Solution
- Write a program which inputs three integers and
prints the middle value of the two.
Solution
- Write a program which inputs two integers and prints the largest
multiple of the second which is smaller than the first, and the smallest
multiple of the second which as at least as large as the first.
That is, input n and d, then find i and j such so that
and print (i*d) and (j*d).
Solution
- Write a program that accepts four integers, i, j, k, n and
prints which of the relations is correct:
For this problem, do not use floating point arithmetic. You should
determine the equality or inequality using only integer arithmetic.
Solution