Question: Question 3 polis Write a recusive method, called sequence), which prints a sequence of numbers, separated by a white space, starting from the number, which
Question 3 polis Write a recusive method, called sequence), which prints a sequence of numbers, separated by a white space, starting from the number, which is given as a parameter to the method. Then, the next element ng of the sequence is (64-1/2) If ng is even, otherwise, it is (3 - 09-1 + 1) The sequence ends with 1 void sequence(int n) { ) Example: sequence(20) will print 20 10 5 16 8 4 2 1 sequence(3) will print: 3 10 5 16 8 4 2 1 For the toolbar, press ALT+F10 (PC) or ALTEN+F10 (Mac) I us Paragraph Arial 14px BE X > A T. O WORDS PO MacBook Air Question 3 polis Write a recusive method, called sequence), which prints a sequence of numbers, separated by a white space, starting from the number, which is given as a parameter to the method. Then, the next element ng of the sequence is (64-1/2) If ng is even, otherwise, it is (3 - 09-1 + 1) The sequence ends with 1 void sequence(int n) { ) Example: sequence(20) will print 20 10 5 16 8 4 2 1 sequence(3) will print: 3 10 5 16 8 4 2 1 For the toolbar, press ALT+F10 (PC) or ALTEN+F10 (Mac) I us Paragraph Arial 14px BE X > A T. O WORDS PO MacBook Air
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
