Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

37-CreatingMethodsByPattern

According to the n value received from the user, the program is designed using a "Recursive" method without using a loop that follows the rule below.

Rules:

Subtract 5 from the entered number up to where the entered number is 0 or negative.

During each subtraction, the last value is printed on the screen.

After the number becomes negative or 0, 5 is added again.

Again, in each addition operation, the last value of the number is printed on the screen.

Screenshot_5-horz-vert