Monday, March 22, 2010

lab 10

1) Write a function which takes in an int and returns an int:
square
cube
absolute

2) Write a function which takes in two integers and returns an int:
power(X, Y) will return X^Y
sum(X, Y) will return X+Y
difference(X, Y) will return X-Y
product(X,Y) will return X*Y

3) Write a function which takes in two integers and returns a bool
isBigger(X,Y) will return true if X is bigger than Y and false otherwise
isSmaller
isEqual

4) Write a function printRange(X, Y) which returns void. It will print the numbers in the range of X through Y.

After writing each of these functions, call them from a main function.

No comments:

Post a Comment