Advertisement
virtualideaz

Do-While Statement

Oct 22nd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. //
  2. //this is a repitition statement
  3. //
  4. public class RepititionStatements {
  5.     public static void main(String [] args) {
  6.         //this is a do-while loop
  7.        
  8.         int x = 1;
  9.            
  10.         do
  11.         {
  12.             System.out.println("the value of x : " + x);
  13.             x++;
  14.         } while (x < 10);
  15.     }
  16. }
  17.  
  18. --copy until here--
  19.  
  20. OUTPUT:
  21.  
  22. the value of x : 1
  23. the value of x : 2
  24. the value of x : 3
  25. the value of x : 4
  26. the value of x : 5
  27. the value of x : 6
  28. the value of x : 7
  29. the value of x : 8
  30. the value of x : 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement