Write a program in java to find the even number between 200 - 400 which are divisible by 5 but not divisible by 6
Answers
Explanation:
I took i+=10; because there is no even number divisible my five except multiples of 10
Hope it helps
Mark me the brainliest and follow me plzz
Program in java:
Explanation:
public class Prog//class definition.
{
public static void main(String[] args) //main function definition.
{
int number=200;//variable which holds the starting value.
while(number<=400) //while loop which runs from 200 to 400.
{
if((number%5==0)&&(number%6!=0))//if condition.
System.out.println(number);//prints the value.
number=number+2;
}
}
}
Output :
200
220
230
250
260
280
290
310
320
340
350
370
380
400
Code Explantion:
- The above code is in java language, which have a loop which runs from 200 and ends in 400,
- It will check all the even number to be divisble by 5 but not divisble by 6 and that number will be printed on the screen.
Learn More:
- Java : https://brainly.in/question/13792074