Code Below:


import java.util.*;
class pythagoras
{
    public static void main ()
    {
        Scanner s= new Scanner (System.in);
        System.out.println("Enter 3 sides of triangle");
        int h=s.nextInt();           //hypotenuse of triangle
        int p=s.nextInt();           //perpendicular of triangle
        int b=s.nextInt();           //base of triangle
        if (h*h==p*p+b*b)
        System.out.println("It forms a pythagorean triplet");
        else if (p*p==h*h+b*b)
        System.out.println("It forms a pythagorean triplet");
        else if (b*b==h*h+p*p)
        System.out.println("It forms a pythagorean triplet");
        else
        System.out.println("It does not form a pythagorean triplet");
    }
}