Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class DivisibleByTwoNumbers{
- public static void main(String a[])
- {
- Scanner sc=new Scanner(System.in);
- System.out.print("enter the two numbers : ");
- int m=sc.nextInt();
- int n=sc.nextInt();
- int count=0;
- for(int i=1;count<10;i++){
- if(i%m==0 && i%n==0)
- {
- System.out.print(i+" ");
- count++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement