Programming Questions and Exercises : Loops
Question 1 Write a program to print numbers from 1 to 10. Show the answer. public class PrintNumbers { public static void main(String[] args) { for(int i=1; i<=10; i++) { System.out.println(i); } } } Question 2 Write a program to calculate the sum of first 10 natural number. Show the answer. public class SumNumbers {…