Ask Question

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).

+4
Answers (1)
  1. 21 December, 13:49
    0
    We must create a cycle for to count 5 by 5 then a with a conditional if, we are going to identify every multiple of 50 to start in a new line.

    class Count{

    public static void main (String[] args) {

    for (int i=5; i<=500; i+=5) {

    System. out. print (i + " ");

    if (i%50==0)

    System. out. println ();

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “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, ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers