Ask Question
25 June, 05:43

Create a loop that will output all the numbers less than 200 that are evenly divisible (meaning remainder is zero) by both 5 and 7. 35, 70, 105, 140, 175

+5
Answers (1)
  1. 25 June, 08:49
    0
    public class num7 {

    public static void main (String[] args) {

    int n = 1;

    while (n<200) {

    if (n%5==0 && n%7==0) {

    System. out. print (n);

    System. out. print (",");

    }

    n++;

    }

    }

    }

    Explanation:

    In Java programming Language Create and initialize an int variable (n=1) Create a while loop with the condition while (n<200) Within the while loop use the modulo operator % to check for divisibility by 5 and 7 Print the numbers divisible by 5 and 7
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Create a loop that will output all the numbers less than 200 that are evenly divisible (meaning remainder is zero) by both 5 and 7. 35, 70, ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers