// Program to display numbers from 1 to 5 class Main { public static void main(String[] args) { // declare variables int i = 1, n = 5; // while loop from 1 to 5 while(i <= n) { System.out.println(i); i++; } } }