1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mart [117]
3 years ago
10

In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sid

es. Write a program that prompts the user to enter the lengths of three sides of a triangle and then outputs a message indicating whether the triangle is a right triangle. If the triangle is a right triangle, output It is a right angled triangle If the triangle is not a right triangle, output It is not a right angled triangle.
Computers and Technology
1 answer:
Anna [14]3 years ago
3 0

Answer:

// here is program in C.

// include header

#include <stdio.h>

#include<math.h>

//main function

int main()

{

 // variables

 int x,y,z;

 int flag=0;

 // ask to enter the sides of triangle

 printf("enter the length of all sides of triangle:");

 // read the sides

 scanf("%d %d %d",&x,&y,&z);

 // check if square of any side is equal

 //to sum of square of other two sides

 if((x*x)==(y*y)+(z*z)||(y*y)==(x*x)+(z*z)||(z*z)==(y*y)+(x*x))

 flag=1;

 // if right angled triangle

 if(flag==1)

     printf("right angled triangle.\n");

// if not right angled triangle

 else

     printf(" not  a right angled triangle.\n");

   return 0;

}

Explanation:

Read the sides of the triangle and assign them to x,y,z respectively.Then check ((x*x)==(y*y)+(z*z)||(y*y)==(x*x)+(z*z)||(z*z)==(y*y)+(x*x)).If it true then set flag=1.After this if flag==1 then print triangle is right angled else not right angled.

Output:

enter the length of all sides of triangle:3 4 5

right angled triangle.

You might be interested in
4.8 Code Practice: Question 1
Furkat [3]

Answer:

c = 1 # global variable

    jhjl jh

def add(): c = 1 # global variable

def add():

   print(c)

add()

   c = c + 2 # increment c by 2

   print(c)

add()

Explanation:

4 0
2 years ago
Read 2 more answers
A binary search algorithm is written (as in the modules, for example) which searches a pre-sorted array for some user-defined va
Mazyrski [523]

Answer:

c) it will always return with an answer of 7 or fewer comparisons of data.

Explanation:

As maximum number of comparison in worst case for sorted binary search is log₂n, here n = 100, so maximum search is at least 6.6 which is approximately 7.

4 0
3 years ago
What is one benefit of Powerpoint Online?
VashaNatasha [74]

Answer:

for edge users

anyone with the url

Explanation:

6 0
3 years ago
Read 2 more answers
)In a vector implementation of a stack ADT, you add an entry to the top of a stack using which vector method?
kotykmax [81]

Answer:

B.add.

Explanation:

boolean add(element)

The add method in java inserts an element in the vector.It's return type is Boolean it returns true if the element is successfully inserted in the vector and false if the operation is unsuccessful.There is no Push operation in vector.Hence we conclude that the answer is add.

8 0
3 years ago
TRUE OR FALSE!!! <br> Your location can be tracked via your digital footprint.
laiz [17]
Sadly this statement is true
3 0
3 years ago
Other questions:
  • When you enable user access control (uac)
    11·1 answer
  • In Microsoft word,when you highlight existing text you want to replace ,you’re in?
    12·1 answer
  • Why is it important to send a cover letter with a resume?
    12·2 answers
  • The main activity area or the brain of the computer is called the ________
    15·1 answer
  • Produce definition in computer
    12·2 answers
  • Which of the following describes the function of a web browser?
    11·1 answer
  • Jim is expecting a very busy weekend at his store, so he sent the following e-mail to his employees: ALL EMPLOYEES MUST WORK THI
    6·1 answer
  • my airpods just do not seem to connect if i try to pair them, reset them, they have this continuous green light, please help me
    12·1 answer
  • When individuals not involved in the development process are asked to test the game, this is called ________ group testing.
    11·1 answer
  • Which view in the View tab of the ribbon is the easiest place to add a header or a footer? Normal view Custom Views Page Layout
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!