You are on page 1of 1

Problem 1:

Write the code for the function int max2(int x, int y); that takes two integers x and y as
arguments, and returns the largest of x and y. Write a main() program to test your function.
Problem 2:
Write the code for the function int sumK (int N); that takes a positive integer N (assuming
N > 1) as the argument, and returns the result of the summation of all the positive integers from 1
to N (inclusive). Write a main() program to test your function.
Problem 3:
Write the code for the function bool isEven (int N); that takes a positive integer N as the
argument, and returns true if N is an even integer; otherwise, it returns false. Write a main()
program to test your function.

You might also like