Write a program in qbasic to accept three numbers and check whether they are Pythagorean triplet. The program must display the message accordingly
Answers
Answered by
4
import java.util.*;
{
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");
}
}
Kritagyan4555:
Not in java
Similar questions
Math,
7 months ago
CBSE BOARD XII,
7 months ago
Science,
1 year ago
Math,
1 year ago
Math,
1 year ago