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
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
Physics,
4 months ago
Math,
4 months ago
Computer Science,
9 months ago
Math,
9 months ago
Science,
11 months ago