Answer to Question #316227 in Java | JSP | JSF for bhupendra

Question #316227


debug the code for displaying numbers 1 to 10 using do￾while loop.

Class doWhile

{

public static void main(String[] args)

{

int num =1;

do

{

System.out.println(num);

}while(num>=10)

}

}


1
Expert's answer
2022-03-22T19:07:49-0400
public class doWhile{

public static void main(String[] args){

    int num = 1;

    do{
        
        System.out.println(num);
        num++;
        } while(num<=10);

    }

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS