66 982
Assignments Done
99,2%
Successfully Done
In November 2018

Answer to Question #3497 in Java | JSP | JSF for Y mukundareddy

Question #3497
2. Write a program to print the numbers and use the continue statement when n=10. (Note n should be more than 10)
Expert's answer
import java.util.Random;


public class ContinueWhen10
{
public static void main(String[] args)
{
Random generator = new Random();
int n = generator.nextInt(20) + 11;
System.out.println("The total amount of numbers (n) = " + n);
for (int i = 0; i < n; i++)
{
if (i == 10)
continue;
System.out.print(i + " ");
}
}
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions