Write a Java program that starts with an integer n, divides n by 2 if n is
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a Java program that starts with an integer n, divides n by 2 if n is even, or multiplies by 3, and add 1 if n is odd, repeat the process until n = 1.
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: