Ask Question
5 August, 01:16

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

+1
Answers (1)
  1. 5 August, 02:39
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers