Problem Statement
1.In main() read two distinct positive integers s and l, s < l. Do not expect that the user
provides them in any specific order.
2.Compute the sum of the integers ≤ s and not relatively prime to l. Print the sum and the count
of these integers.
s l sum count numbers
10 18 42 7 {2, 3, 4, 6, 8, 9, 10}
27 55 108 7 {5, 10, 11, 15, 20, 22, 25}
2. Write a recursive function int isPrime(int n, int fp) to test whether the first parameter n, a positive int data, is prime. The function returns 1 if n is a prime, otherwise it
returns 0. When isPrime() is called for the first time, two (the first prime number) is pas sed
as the second parameter. [Your function should not contain any loop construct. You get 50%
credit if you write an iterative function.]
3. Write a non-recursive function int printPrime(int s, int l) that prints all primes
p, so that s ≤ p ≤ l. It returns the count of primes in this range. This function calls the function
isPrime() to test primality. [You get 50% credit if you write a recursive function.]
4. Call printPrime() from main() with s and l as actual parameters. Also print the prime
count in the range s ≤ p ≤ l from main().
s l primes count
10 18 {11, 13, 17} 3
27 55 {29, 31, 37, 41, 43, 47, 53} 7