slove 2 of computer
Attachments:
anshumanrajManjhi:
java
Answers
Answered by
0
import java.util.*;
public class q2
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int d,a,b;
a=in.nextInt();
b=in.nextInt();
d=a-b;
if(d==1||d==-1)
{
System.out.println("co prime are"+a+b);
else
System.out.println("are not co prime");
}
}
}
public class q2
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int d,a,b;
a=in.nextInt();
b=in.nextInt();
d=a-b;
if(d==1||d==-1)
{
System.out.println("co prime are"+a+b);
else
System.out.println("are not co prime");
}
}
}
Similar questions