Question: Using R Programming Language Write a function called print_numbers that takes two parameters num1 and num2. If num1 is less than num2, the function executes
Using R Programming Language
Write a function called print_numbers that takes two parameters num1 and num2. If num1 is less than num2, the function executes a for loop printing the numbers from num1 to num2. (if num1=1, nums2=10, print 1, 2, 3 10). Else, the function executes a while loop that prints numbers from num2 to num1. Hint: In while loop, set condition to num2 > num1, and minus 1 from num2 at the end of the while loop.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
