Question: See the image below and write the code using C++, without using variables, only recursion. 3. 5 a [DO NOT USE ANY VARIABLES Write a
See the image below and write the code using C++, without using variables, only recursion.
3. 5 a [DO NOT USE ANY VARIABLES Write a C++ function that takes two integer parameters (a and b) and prints a list of all the integers between a and b-1 (inclusive). one (2, 12) should print 2 34567 8 9 10 11. one (2, 13) should print 2 34567 8 9 10 11 12 b. [D NOT USE ANY VARIABLES Write a C++ function that is the same as the first one, except that it only prints out the numbers between a and b-1 that b is exactly divisible by two (2, 12) should print 2 346. two (2, 13) should print nothing. C. [DO NOT USE ANY VARIABLES] Write a C++ function that is very similar to the second one, except that it doesnt print anything, it just returns as its result the number of things that two would print. three(2, 12) returns 4, because two(2, 12) prints four things three(2, 13) returns 0, because two(2,13) prints nothing. Hint: If this seems a little tricky, first write a function that would return true if two would print anything at all, and false if two would print nothing. d. [D NOT USE ANY VARIABLES] You are probably aware that a number that has no divisors except for 1 and itself is called a prime number Using your previous answers, write a function that takes one integer parameter n, and if n is prime prints out the word "prime", and if n is not prime prints out all the divisors of n. four(11) ohould print prime four (12) should print 2 3 46 four (13) should print prime four(14) should print 2 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
