public class CodeSnippets { public static void main(String[] args) { System.out.println("a) Print the odd numbers from 1 to 100"); for(int i=1; i<100; i+=2) System.out.print(i + ", "); System.out.println("\n\n"); System.out.println("b) Print the numbers between 1 and 1000 that are powers of 2"); for(int p=2; p< 1000; p*=2) System.out.print(p + ", "); System.out.println("\n\n"); System.out.println("c) Calculate and print the sum of the numbers between 1 and 100 (inclusive)"); int sum=0; for(int n=1; n<=100; n++) sum+=n; System.out.println(sum); } }