Professional Documents
Culture Documents
Paper 5
Paper 5
Week 5 - Pointers
b.
c.
d.
e.
f.
g.
h.
You should write a program that reads x and y from the user, and
include a statement that sets the value of q to the quotient of x
divided by y, and sets the value of r to the remainder of x divided
by y, by calling the above function.
4. 1-minMax is a function that takes five arguments and returns
no value. The first three arguments are of type int. The last two
arguments are pointers to int that are set by the function to the
largest and smallest of the values of the first three
parameters, respectively. big and small are two int variables that
have been declared in the main function. Write a program that
scans x,y,z and sets the value of big to the largest of x, y, z and
sets the value of small to the smallest of x, y, z by calling
minMax.
Example:
Enter amount to withdraw:130
Number of 50:2
Number of 20:1
Number of 10:1