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 exact value of cos 45º ? Enter your answer, as a simplified fraction, in the box.
Please help me with this:)
why does wiesel use deductive reasoning in this passage?​
(Art history) Answer these 4 questions for 50 points in 3-4 sentences! Thank youuu :)
A mis amigos les gusta tomar ____ (their) refrescos con limón.
List two factors that determine where an organism lives in an aquatic ecosystem
when did native Americans first arrive in the Americas​
What is the value of the discriminant for the quadratic equation 0 = x + 2 + x2? Discriminant = b2 – 4ac
The graph of a linear equation contains the points (4,1) and (-2,-11). Which point also lies on the graph?
I NEED HELP WITH BIOLOGY PLEASE