Syntax import java.*; import java.io.*; import java.util.*; class while_loop { public static void main(String arg[]) { // 1 to 10 print by using while loop int count=1; while(count <= 10) { System.out.println("Count Value is : "+count); count++; // count = count +1 } } }
OUTPUTCount Value is : 1 Count Value is : 2 Count Value is : 3 Count Value is : 4 Count Value is : 5 Count Value is : 6 Count Value is : 7 Count Value is : 8 Count Value is : 9 Count Value is : 10See How to Implement This Program :please Subscribed this tutorial to : Click here