Computer Science, asked by creatingmyselfrn, 9 months ago

write a program in java using Scanner Class and input a,b & c to check whether they are a Pythagoras triplet or not. ​

Answers

Answered by puppireddycharithesh
2

Answer:

import java.util.*;

class A {

public static void main( String args[] ) {

int a,b,c;

Scanner sc = new Scanner( System.in);

a = sc.nextInt();

b = sc.nextInt();

c = sc.nextInt();

if ( (a*a + b*b) == c*c) {

System.out.println(" pythagoras triplet");

}

else {

System.out.println(" not a pythagoras triplet");

}

}

}

Similar questions