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

which relationship between two species listed would be mutually beneficial A) a fish and a leech B) a dog and a tick C) a flower plant and a bee or D) a tree an
88% of the student body voted if school has an enrollment of 350 students how many students voted in the last election
Are the graphs of y=3/8x -5 and y=3/8x +2 parallel?
Express on simplest form in terms of i: sqrt-16
1.34 expressed as a percent
what number can 13 and 7 go into?
Name two types of adaptations having to do with an animals action.
Which describes a spontaneous reaction? a. Positive ΔH b. Negative ΔH c. Positive ΔG d. Negative ΔG e. Positive ΔS
a warm moist air moves into a region barometric pressure readings in the region will generally
A small 0.280-kg object moves on a frictionless horizontal table in a circular path of radius 4.10 m. The angular speed is 3.08 rad/s. The object is attached to