import java.util.*; import java.io.*; class Main { public static String PowersofTwo(int num) { if (num > 0 && (num & (num - 1)) == 0) { return "true"; } else { return "false"; } } public static void main (String[] args) { System.out.println(PowersofTwo(4)); // Output: true System.out.println(PowersofTwo(124)); // Output: false System.out.println(PowersofTwo(16)); // Output: true System.out.println(PowersofTwo(22)); // Output: false } }