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
dolphi86 [110]
3 years ago
8

Write a program that prompts the user for the lengths of the two legs of a right triangle, and which reports the length of the h

ypotenuse. Recall that the hypotenuse length satisfies the formula:
c =√ (a² + b²)
Computers and Technology
1 answer:
timurjin [86]3 years ago
3 0

Answer: The following code is in c++

#include <iostream>

#include<math.h>

using namespace std;

int main()

{

   float a,b,c;

   cout<<"Enter height and base of triangle\n";

   cin>>a>>b;  //reading two sides from user

   c=sqrt(pow(a,2)+pow(b,2));  //calculating hypotenuse

   cout<<"Length of hypotenuse is "<<c;  //printing third side of triangle

   return 0;

}

OUTPUT :

Enter height and base of triangle                                                                                            

3                                                                                                                              

4                                                                                                                              

Length of hypotenuse is 5  

Explanation:

In the above code, three variables a, b and c of int type are declared. After that, it is asked from user to enter the value of a and b. The user puts the value and then c is calculated with the help of Pythagoras theorem formulae which squares the values of two sides and then adds them to calculate hypotenuse of a right angled triangle and finally c is printed to console.

You might be interested in
What is the use of html in websites
Alborosie
HTML is a very basic markup language and requires memorization of a few dozen HTML commands that structure the look and layout of a web page. Before writing <span>any HTML code or designing your first web page, you must decide on an HTML editor or text editor, such as Notepad or Word Pad.</span>
4 0
3 years ago
Read 2 more answers
Which type of connection to the Internet is capable of the fastest transfer rates
dem82 [27]

That's a fiber connection direct to the internet service provider,
and a whopping monthly charge.

5 0
3 years ago
Read 2 more answers
Guys helppppppppppppp!! plxxx <br> give me the right answer !
sweet-ann [11.9K]
Try "an online advertisement for a video game you recently read about in a blog post".

Hope I helped! :)
5 0
3 years ago
True or false As the contents and topics of new magazines change year-to-year, you can see various trends and movements across s
Tamiku [17]

the short answer is true.

The long answer is that magazines can help shape and invent new trends.  like they have time and time again in the past.

Hope this helps

-scav

8 0
2 years ago
FILL IN THE BLANK.
Veseljchak [2.6K]

Answer:

It is measured in megahertz (MHz) and gigahertz (GHz).

Hope this helps.

3 0
3 years ago
Other questions:
  • You have two LANs connected via a router. Network 1 has a DHCP server with a single Ethernet interface. Network 2 does not have
    9·2 answers
  • The seven basic internal components found in a computer tower
    9·1 answer
  • In cell B20, enter a function to calculate the average attendance for 2018
    11·1 answer
  • What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
    6·1 answer
  • Which of the following behaviors does not harm a company if your employment is terminated?
    9·1 answer
  • Simone needs to add a query for multiple tables in her database. She is using Access 2016. Which tab should she use to add the q
    5·1 answer
  • There are ______ type of accounts
    14·2 answers
  • Please NEED HELP ASAP WILL MARK BRAINLIEST ONLY #8
    8·1 answer
  • Write a program that asks the user for the name of a text file. The program should display the first 10 lines of the file on the
    6·1 answer
  • Which of the following are vector graphic file formats? Choose all that apply.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!