Right Angled Triangle or Not2 months ago

The program is to accept three sides of a triangle and check if the triangle is a right angled triangle or not.
Note: In a right angled triangle the square of the hypotenuse is equal to the sum of the squares of the other two sides.

Boundary Condition(s):
1 <= Length of the sides <= 1000

Input Format:
The first line contains three integers denoting the length of the sides separated by a space.

Output Format:
The first line contains yes or no.

Example Input/Output 1:
Input:
5 4 3

Output:
yes

Example Input/Output 2:
Input:
8 5 6

Output:
no

The below video explains the logic and the implementation in C programming language to check if the given triangle is a right angled triangle or not.

#include <stdio.h>

int main()
{
    int side1,side2,side3;
    scanf("%d%d%d",&side1,&side2,&side3);
    if(side1*side1 == side2*side2+side3*side3 ||
            side2*side2 == side1*side1+side3*side3 ||
            side3*side3 == side1*side1+side2*side2)
    {
        printf("yes");
    }
    else
    {
        printf("no");
    }
    return 0;
}

 

side1, side2, side3 = map(int, input().split())
if side1*side1 == side2*side2+side3*side3 or side2*side2 == side1*side1+side3*side3 or side3*side3 == side1*side1+side2*side2:
	print('yes')
else:
	print('no')

 

import java.util.Scanner;

public class Hello {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int side1 = sc.nextInt();
        int side2 = sc.nextInt();
        int side3 = sc.nextInt();
        if (side1 * side1 == side2 * side2 + side3 * side3
                || side2 * side2 == side1 * side1 + side3 * side3
                || side3 * side3 == side1 * side1 + side2 * side2) {
            System.out.print("yes");
        } else {
            System.out.print("no");
        }
    }
}

 

#include <iostream>

using namespace std;

int main()
{
    int side1, side2, side3;
    cin >> side1 >> side2 >> side3;
    if(side1*side1 == side2*side2+side3*side3 ||
            side2*side2 == side1*side1+side3*side3 ||
            side3*side3 == side1*side1+side2*side2)
    {
        cout << "yes";
    }
    else
    {
        cout << "no";
    }
    return 0;
}