You're given an unfinished program that should output all powers of two that are lower than the number entered by the user. Complete the for-loop parts so that the program will work correctly.
For loop
Powers of two
Report a typo
Fill in the gaps with the relevant elements
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long num = scanner.nextLong();
for ( i = 1; i < ; ) {
System.out.println();
}
}
}Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.