Computer Science, asked by jfwentzel, 1 day ago

does anyone know how to write a program that uses a while loop to calculate and print the multiples of 3 from 3 to 21. the program should print each number on a separate line.

Answers

Answered by samarthkrv
0

Answer:

public class Main

{

public static void main(String[] args) {

 int i = 0;

     while(i < 21)

     {

       i++;

       if(i%3 == 0)

         System.out.println(i);

     }

}

}

Explanation:

Similar questions