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
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
Economy,
16 hours ago
Hindi,
1 day ago
Political Science,
1 day ago
Math,
8 months ago
Chemistry,
8 months ago