Commit c6f4eec2 authored by 9731001's avatar 9731001

lab1

parents
Pipeline #606 failed with stages
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int num1 , num2;
System.out.println("Enter the first number");
num1 = sc.nextInt();
System.out.println("Enter the second number");
num2 = sc.nextInt();
int i , temp = 0;
if(num1>=num2){
for(i=2;i<=num2;i++){
if(num2%i==0 && num1%i==0)
temp++;
}
}
if(num2>num1){
for(i=2;i<=num1;i++){
if(num1%i==0 && num2%i==0)
temp++;
}
}
if(temp==0){
System.out.print("Aval hastand");
}
else
System.out.print("Aval nistand");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment