2. Write a program to print the numbers and use the continue statement when n=10. (Note n should be more than 10)
1
Expert's answer
2011-08-16T11:55:33-0400
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 + " "); } } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment