import java.util.*;
class Pthagorean_Triplet
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
int a,b,c;
System.out.println("Enter the three numbers");
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if(a*a+b*b==c*c)
System.out.println("Pythagorean Triple");
else
System.out.println("Not Pythagorean Triple");
}
}
Output:
Enter the three numbers:
3
4
5
Pythagorean Triple.
class Pthagorean_Triplet
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
int a,b,c;
System.out.println("Enter the three numbers");
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if(a*a+b*b==c*c)
System.out.println("Pythagorean Triple");
else
System.out.println("Not Pythagorean Triple");
}
}
Output:
Enter the three numbers:
3
4
5
Pythagorean Triple.