A Java Program to show the use of While Loop.
publicclass JAVA_028 { publicstaticvoid main(String[] args) { int limit=20; int sum=0; int i=1; while(i<=limit) { sum+=i; i++; } System.out.println("Sum of first 20 integers = " + sum); } }