(C PROGRAM ONLY) 1. Undercover Mission Plan by CodeChum Admin Hi Programmer, I'm Agent J. I'm preparing for an undercover mission going to the enemy's base. However, it seems that my plans are still missing some few details. Can you help me with this? Instructions: In the code editor, there's a main() function that calls the recursive printPlan() function. The printPlan() function already contains some code but it seems to be missing a base case that makes it stop. Supposedly, this printPlan() function should only print the plan by n / 2 number of times. For example, if n is 10, then this should only print the plan 5 times or if n is 20, then this should only print the plan 10 times. Fix this function by adding the correct condition in its base case. For this problem, assume that the value of n is always divisible by 2. Input 1. Value of n Output Enter n: 6 Plan by Agent J. Plan by Agent J. Plan by Agent J.
(C
1. Undercover Mission Plan
by CodeChum Admin
Hi Programmer, I'm Agent J.
I'm preparing for an undercover mission going to the enemy's base. However, it seems that my plans are still missing some few details.
Can you help me with this?
Instructions:
In the code editor, there's a main() function that calls the recursive printPlan() function.
The printPlan() function already contains some code but it seems to be missing a base case that makes it stop. Supposedly, this printPlan() function should only print the plan by n / 2 number of times. For example, if n is 10, then this should only print the plan 5 times or if n is 20, then this should only print the plan 10 times.
Fix this function by adding the correct condition in its base case.
For this problem, assume that the value of n is always divisible by 2.
Input
1. Value of n
Output
Enter n: 6
Plan by Agent J.
Plan by Agent J.
Plan by Agent J.
Step by step
Solved in 3 steps with 1 images