Challenge: The Nearest Power of 2
Explore how to create a Java program that identifies the nearest power of 2 to a given number. Learn to apply loops and decision-making skills to solve this problem, handling cases where two powers of 2 are equally close. This lesson helps you practice logic development and strengthens your understanding of repetition structures in Java programming.
Task
Write a program that takes a positive number (num) and finds the power ...