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

what is the land between two normal faults that may be uplifted to form?
A sequence has an initial value of 10 and each term is twice the previous.  Which function models this sequence?1. a(n)=10(2)"n2. a(n)=10(2)n-13. a(n)=10+2n4. a
do rainforests have seasons?  if do What are they?
how do I make h the subject of this formula please?t = gh / 10
If my final exam is worth 30% and my class average is 80, what do I need to get to pass the exam?
How many tablespoons are in 1 gill?
The perimeter of a rectangle is 34 units. Its width is 6.5 units. What is its length?
Given the equation:y=−2x2−12x−23 Find the parabola's vertex.
How does a magnet separate mixtures?
A machine does 1000 tasks in 4.3 x 10^-2 seconds. How much task will be done in 2 hours? Leave answer in scientific notation.