Computer Science, asked by cathygg, 4 months ago

Write a program that accepts the lengths of three sides of a triangle as inputs. The program output should indicate whether or not the triangle is a right triangle.

Answers

Answered by itzcutejatni
0

Answer:

\huge\underline\mathfrak\red{❥Answer}

Explanation:

First Check Which side is Largest Then Check if Square of Largest side is equal to sum of square of other two sides or not

Step-by-step explanation:

I am giving algorithm

Start

Input side if triangle

as A , B  ,C

if  ( A > B)

{   if ( A > C)

      {  if ( A² = B² + C²)

       {   print :Triangle is right angle triangle}

        Else   {   print :Triangle is not right angle tringle}

  Elseif ( C² = B² + A²)

       {   print :Triangle is right angle triangle}

        Else   {   print :Triangle is not right angle triangle}

      }

Elseif  ( B > C )

   if ( B² = C² + A²)

       {   print :Triangle is right angle triangle}

        Else   {   print :Triangle is not right angle triangle}

  Elseif ( C² = B² + A²)

       {   print :Triangle is right angle triangle}

        Else   {   print :Triangle is not right angle triangle}

}

End

Answered by Anonymous
1

First Check Which side is Largest Then Check if Square of Largest side is equal to sum of square of other two sides or not

Step-by-step explanation:

I am giving algorithm

Start

Input side if triangle

as A , B ,C

if ( A > B)

{ if ( A > C)

{ if ( A² = B² + C²)

{ print :Triangle is right angle triangle}

Else { print :Triangle is not right angle tringle}

Elseif ( C² = B² + A²)

{ print :Triangle is right angle triangle}

Else { print :Triangle is not right angle triangle}

}

Elseif ( B > C )

if ( B² = C² + A²)

{ print :Triangle is right angle triangle}

Else { print :Triangle is not right angle triangle}

Elseif ( C² = B² + A²)

{ print :Triangle is right angle triangle}

Else { print :Triangle is not right angle triangle}

}

End

Similar questions