while loop in java

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        // TODO code application logic here

      int x = 30;

      while( x < 40 ) {
         System.out.print("value of x : " + x );
         x++;
         System.out.print("\n");
      }
   }
output:
value of x : 32
value of x : 33
value of x : 34
value of x : 35
value of x : 36
value of x : 37
value of x : 38
value of x : 39

No comments:

Post a Comment

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...