-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdivision.java
More file actions
25 lines (25 loc) · 796 Bytes
/
division.java
File metadata and controls
25 lines (25 loc) · 796 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
import java.io.*;
class division
{
static int i;
public static void main(String args[])throws IOException
{
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
System.out.println(" ENTER THE LIMIT OR RANGE ");
int n=Integer.parseInt(buf.readLine());
System.out.println(" ENTER A NUMBER ");
int m=Integer.parseInt(buf.readLine());
System.out.println(" THE NUMBERS DIVISIBLE BY "+m+" BETWEEN 1 AND "+n+" ARE---- ");
for(i=1;i<=n;i++)
{
if(i%m==0)
{
System.out.print(i);
if(i%2==0)
System.out.println(" EVEN ");
else
System.out.println(" ODD ");
}
}
}
}