Question: Write a function seq ( num ) that prints a sequence of numbers based on the following rules starting with num: If the current number
Write a function seqnum that prints a sequence of numbers based on the following rules starting with num:
If the current number is even, next number current number
If the current number is odd, the next number current number
Print the numbers of the sequence until the sequence reaches to or below Note that the value of the first number of the sequence is "num" in the function call and then the series progresses.
Test Cases:
seq
seq
seq
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
