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
kompoz [17]
3 years ago
13

Input an int greater than 0 and print every multiple of 5 between it and 0 inclusive in descending order. If the number is not g

reater than 0 print "error". Print all numbers on one line with single spaces in between.
Example:
Enter a positive integer:
42
40 35 30 25 20 15 10 5 0
Computers and Technology
1 answer:
Alexus [3.1K]3 years ago
8 0

import java.util.Scanner;

public class JavaApplication42 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a positive integer:");

       int num = scan.nextInt();

       if (num < 0){

           System.out.println("error");

       }

       else{

           while(num >=0){

               if (num %5 == 0){

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

               }

               num--;

           }

       }

   }

I hope this helps!

You might be interested in
How is steering different from turning ? Need help //:
kotykmax [81]

Turning you go make a turn steering is where you keep yourself on the road.

6 0
3 years ago
Why do i get message notifications but when i click on it it says i have no new messages?
jeka57 [31]

Answer:

Might just be a glitch you should try to ignore it for the time being or you can log out then log in to your acc

Explanation:

good luck

4 0
3 years ago
PLZ HELP FAST!!!! 
garik1379 [7]
Portable computing tools for example laptop
4 0
4 years ago
Read 2 more answers
Darian is preparing for a presentation about the poor condition of the locker rooms at school. Match each of the key components
Gemiola [76]

Answer:

Purpose - To paurswade the board to change the conditions of the locker room

Topic - Locker room condition

Method - Electronic Slideshow

Audience - School Board

7 0
3 years ago
Sarah needs help with a presentation that she is giving the next day. What are the best ways for her to share her work to get im
Papessa [141]

Answer:

Office365 with PowerPoint Online comment accessibility.

7 0
3 years ago
Read 2 more answers
Other questions:
  • You will use the _____
    15·2 answers
  • To create a formula in ____, you would first click in one of the cells.
    15·2 answers
  • (2) Complete the get_num_of_characters() function, which returns the number of characters in the user's string. We encourage you
    5·1 answer
  • Use a for/else loop to traverse through the key names in the dictionary below in order to find Mr. Potatohead’s mailing address.
    7·1 answer
  • Sistema binario, realizar el pasaje de binario a decimal; 00110011 11101100 11100001 11001100 10010101 11001111 10000001 1000110
    14·1 answer
  • select the correct answer from each drop-down menu. “To clean a computer screen, use ___. To clean a keyboard, use a ___.”
    7·1 answer
  • Terrell, a programmer, is creating a website for an online merchant and wants the program to calculate the total price based on
    14·2 answers
  • What is bit in computer science? (You must select all correct answers.) Hb. A. A part of a tool, such as a router. Non. B. A bas
    6·2 answers
  • Choosing a per_formatted presentation that already has a design and the slots is called choosing What​
    8·1 answer
  • Given main(), complete the Car class (in files Car.h and Car.cpp) with member functions to set and get the purchase price of a c
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!