Computer Science, asked by raju176, 1 year ago

WAP in Java to accept the angles of a triangle state if it is right acute or obtuse angle triangle

Answers

Answered by vikrantpalle
7
Writing sop instead of System.out.println
You have to import Java.util.Scanner
Scanner in=new Scanner(System.in);
sop("enter angles of triangle");
int a=in.nextInt();
int b=in.nextInt();
int c=in.nextInt();
if(a==90||b==90||c==90)
sop("right angled triangle);
else if(a>90||b>90||c>90)
sop("obtuse angle triangle");
else
sop("acute angled triangle");

if you want to confirm whether the user has actually entered the correct sides of the triangle
if((a+b+c)==180)
and under it you can add the if-else if-else
Similar questions