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 turn all of the below to standard form: 4x10^9 2x10^-5 3.7x10^6 3x10^8
Which power is exclusive to the Senate?
Plz help me with these 4 questions 15-18 about Pythagorean theorem.
What Are The Merits And Demerits Of Socialism?
the topic of the worksheet is called Evaluate the Expressions the problem i have to answer is (-8)^3 divided by 2^3 ? how do i solve this.
Which power is exclusive to the Senate?
Old Yeller: Which character is described as shiftless? A. Bud Searcy B. Burn Sanderson C. little Arliss D. Lisbeth Searcy
how are the feet of a frog adapted for swimming
Why do you think that the United States demanded a 99-year lease on military and naval bases in the Philippines?
I am currently studying about spectrums, difraction Gratings, and many other spectrum. So my question is: What should the Spectrum of the Moon look like? Justif