using for loop
what will be the source code of the program that the output will be printing all numbers that is divisible by 3 and 5
sample output:
3 is divisible by 3
5 is divisible by 5
6 is divisible by 3
9 is divisible by 3
10 is divisible by 5
12 is divisible by 3
15 is divisible by 3
15 is divisible by 5
View Answers
February 23, 2012 at 3:37 PM
class NumberDivisible
{
public static void main(String[] args){
for( int i=1; i<=100; i++)
{
if(i%3==0){
System.out.println(i+" is divisible by 3");
}
if(i%5==0){
System.out.println(i+" is divisible by 5");
}
}
}
}
Ads
Related Tutorials/Questions & Answers:
using for loop
using for loop what will be the source code of the program that the output will be printing all numbers that is divisible by 3 and 5
sample output:
3 is divisible by 3
5 is divisible by 5
6 is divisible by 3
9 is divisible by 3
Advertisements
using variable loop
using variable loop program to print alphabets from a-z along with ASCII codes of each alphabets in two columns
using a character variable
loop...can anyone help me
Using while loop to loop through a cursor
Using while
loop to
loop through a cursor
 ....
Understand with Example
The Tutorial grasp you an example on '
Using while
loop to
loop through
a cursor'. The Example create a table Stu_Table
Writing a loop statement using Netbean
Writing a
loop statement
using Netbean Write a
loop program
using NetBeans.
Java Loops
class Loops{
public static void main(String[] args){
int sum=0;
for(int i=1;i<=10;i
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7
Square pattern in java using for loop
Square pattern in java
using for loop please explain the logic to program the following
using for
loop in Java:
1 3 5 7 9
3 5 7 9 1
5 7 8 1 3
7 9 1 3 5
9 1 3 5 7