whocaresfasdlaf3098 whocaresfasdlaf3098
  • 24-02-2020
  • Computers and Technology
contestada

Write an application that counts by five from 5 through 500 inclusive, and that starts a new line after every multiple of 50 (50, 100, 150, and so on). Save the file as Count By Fives.java.

Respuesta :

problemsolver2019
problemsolver2019 problemsolver2019
  • 01-03-2020

Answer:

//package CountByFives.java;

import java.util.*;

import java.io.*;

class Main{

public static void main(String[] args)

{

System.out.println("Enter the maiximum number of numbers");

Scanner sq1=new Scanner(System.in);

int num =sq1.nextInt();

int i=0,n=0,a=10;

while(i <=num)

{  

   

   System.out.print(i);

   i+=5;

   if(n==a)

   {

     System.out.println('\n');

     n=0;

   }

   n=n+1;

}

}

}

Explanation:

Please check the answer section.

Answer Link

Otras preguntas

Please help ASAP!!!!
Should people nap on regular basis? Explain why or why not
How can the Swartz process be modified to work for bacteria? Explain.​
The graph below represents the relationship between the number of days a book is overdue and the library fine charged. A graph titled Library Fines. The horizo
The order that took the longest is represented by point…? This order had___? Cakes and took___ minutes to decorate.
What is the equation for area
3. What does the following quote reveal about ENDER? >>> p.1 "I've watched through his eyes, I've listened through his ears, and I tell you he's the on
Write a rule for the nth term of the sequence. Then find a.. 3. 4, 20, 100, 500, ...
Frank often spills his fruit punch. Below is the number of fruit punch stains in each of the six rooms in his house 4,9,12 21, 22,14 Using the data, create a hi
Pls help D Xd S F D D F D G F F D F D F F