- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththreefourfive.java
More file actions
Latest commit
37 lines (34 loc) · 561 Bytes
/
Copy paththreefourfive.java
File metadata and controls
37 lines (34 loc) · 561 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
packagejavatest;
importjava.util.Scanner;
publicclassthreefourfive {
publicstaticvoidmain(String[] args) {
intc=0;
inti,j;
Scannerab=newScanner(System.in);
i=ab.nextInt();
intk=i;
j=ab.nextInt();
for(;i<j;i++) {
if(i%3==0) {
c=c+1;
}
}
System.out.println("by 3 = "+c);
i=k;
c=0;
for(;i<j;i++) {
if(i%4==0) {
c=c+1;
}
}
System.out.println("by 4 = "+c);
i=k;
c=0;
for(;i<j;i++) {
if(i%5==0) {
c=c+1;
}
}
System.out.println("by 5 = "+c);
}
}