-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc2q3.java
More file actions
27 lines (22 loc) · 722 Bytes
/
Copy pathc2q3.java
File metadata and controls
27 lines (22 loc) · 722 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
// Get input for number and check wahter it is divisible by both 3 and 5 or
//not if yest than print the number is divisible by 3 and 5 print the number
// Steps
// 1 - create a variable called num
// 2 - find out wheter num is divisble by 3 or not
// 3 - find out wheter num is divisble by 5 or not
// 4 - Divisible by 3 && Divisible by 5
import java.util.Scanner;
class c2q3{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int number = scan.nextInt();
if(number % 3 == 0 && number % 5 == 0 )
{
System.out.print("Yes");
}
else{
System.out.print("No");
}
}
}