1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Black_prince [1.1K]
3 years ago
5

Input an int between 0 and 100 and print the numbers between it and 100, including the number itself and the number 100. If the

number is less than or equal to 0, or greater than or equal to 100 print "error". Print 20 numbers per line.
Language: Java
Computers and Technology
1 answer:
Murrr4er [49]3 years ago
6 0

import java.util.Scanner;

public class JavaApplication42 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       int count = 0;

       System.out.println("Enter an integer between 0 and 100");

       int num = scan.nextInt();

       if (num <= 0 || num >= 100){

           System.out.println("error");

       }

       else{

           while(num <= 100){

               if (count == 20){

                   System.out.println("");

                   count = 0;

               }

               else{

                   System.out.print(num+" ");

                   count++;

                   num++;

               }

           }

       }

   }

   

}

I hope this helps!

You might be interested in
Which shortcut keys can be used to duplicate a slide?
Leya [2.2K]

Answer:

Ctrl + D used to duplicate a slide

8 0
3 years ago
What is the first step you should take if unable to make bill payments on time?
Sphinxa [80]

Answer:

"talk to your landlord, creditors or bank about your financial situation to see if they can offer any leniency or a payment plan". just ask for extra time

Explanation:

7 0
2 years ago
You compared each letter in the correct word to the letter guessed.
Murrr4er [49]

Answer:

wow

Explanation:

www

7 0
2 years ago
Alonzo collects bugs. He has created a fascinating display of large insects. Collecting bugs is a(n) _____ to Alonzo.
-Dominant- [34]
The answer is hobby. He does it because he enjoys it. There is no information of him being told or paid to collect bugs, so it is a hobby.
3 0
3 years ago
Read 2 more answers
"Your friend is having a birthday and you want to create a slide-show presentation with pictures of her that you have saved on y
OleMash [197]
Could you be more specific? So I can help you in the best way I can.
5 0
3 years ago
Other questions:
  • Using a loop, write a program that reads in exactly five integers and outputs the sum.
    11·1 answer
  • What shooting position is commonly used when hunting with a shotgun?
    14·2 answers
  • Obtain a file name from the user, which will contain data pertaining to a 2D array Create a file for each of the following: aver
    5·1 answer
  • What adds the element carbon to the environment
    10·2 answers
  • Write an application that determines the value of the coins in a jar and prints the total in dollars and cents. Read integer val
    6·2 answers
  • a. Do you think the U.S. government should censor information on the Web, such as instructions for making weapons, to protect th
    12·1 answer
  • 9. What command do you enter in the Explorer search box to access the Remote Admin share on the computer named Fin?
    7·1 answer
  • Who watches Riverdale ? if you do can we be friends(pLEASE DON'T DELETE) and also who is your fav character from Riverdale
    8·2 answers
  • Which of the following parameters is optional sample(a,b,c,d=7
    9·1 answer
  • How do you modify WordArt? Give specific details and steps<br><br> NEED THIS ASAP
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!