In C program We want to emulate that, too! Using a recursive function, make it so that we print the number we are currently in on a new line. When we encounter a number n divisible by 5, we print...


In C program


We want to emulate that, too! Using a recursive function, make it so that we print the number we are currently in on a new line. When we encounter a number n divisible by 5, we print "YEHEY" and jump 7 steps forward. However when we encounter a number divisible by 8, we print "OHNO" and go back 6 steps. If it is divisible by both, we print "LUCKY" and jump 11 steps. Otherwise just move 1 step. Start at n=1 and continue doing this until you reach a number greater than or equal to the number entered by the user.


Instructions:


In the code editor, you are provided with a main() function that must ask the user for a number and calls the snake_ladder() function.
This snake_ladder() function is a recursive function which should perform the functionality explained in the problem description above.
This function is declared but is initially empty.
Input


1. Stopping number


Description


Input the number to which the recursive function must stop


Constraints


The input is a positive integer that does not exceed 10000.


Sample


100
Output


Enter stopping number: 100
1
2
3
4
5 YEHEY
12
13
14
15 YEHEY
22
23
24 OHNO
18
19
20 YEHEY
27
28
29
30 YEHEY
37
38
39
40 LUCKY
51
52
53
54
55 YEHEY
62
63
64 OHNO
58
59
60 YEHEY
67
68
69
70 YEHEY
77
78
79
80 LUCKY
91
92
93
94
95 YEHEY
102



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here