package com.company;
public class Program40 {
public static void main(String[] args) {
for (int i=0;i<100;i++)
{
if(i%3==0)
{
System.out.println("divisible by 3:");
System.out.println(i);
}
if(i%5==0)
{
System.out.println("divisible by 5:");
System.out.println(i);
}
if(i%5==0 && i%3==0)
{
System.out.println("divisible by 5 and 3:");
System.out.println(i);
}
}
}
}
Hi Friends ! You are on HR Developers website. Here you can find the codes of different languages like c ,c++ , java, pyton and many other languages.
Sunday, June 27, 2021
Java program to print numbers between 1 to 100 which are divisible by 3, 5 and by both (Java) (203)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment