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]
4 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]4 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's it called when a program is expandable?
sashaice [31]
Its called a genesis program
6 0
3 years ago
Kak cheat clans royale
labwork [276]
Um, what? I don't get what you are saying what is your question?
5 0
3 years ago
Which of the following software programs provides for e-mail communication?
Mila [183]
Outlook is a software program that provides for e-mail communication
8 0
3 years ago
A researcher makes a _____ about another population when she makes a generalization.
Katena32 [7]
Prediction I believe is the answer mark me brainliest please
5 0
3 years ago
Which of the following helps create a positive community?
Lera25 [3.4K]

Answer: D.) all of the above

Explanation: By doing all three of these it makes almost everyone in the community is happier and more positive which is better than the bully's & people who don't speak up feel less entitled, it achieves the goal.

5 0
3 years ago
Other questions:
  • FILL IN THE BLANK...............
    8·1 answer
  • What is an advantage of taking notes in a digital format?
    6·2 answers
  • The reason why a database table is in the first normal form (1NF), but not in the second form (2NF) is because:
    12·1 answer
  • In what year was the first mobile phone produced?
    15·1 answer
  • Identify the output, input, and any missing information for the following problem. George wants to find out how much extra he wi
    15·1 answer
  • Enter a character: * ASCII #42 Enter a character: exit Not a character
    7·1 answer
  • Q13. On which option do you click to
    12·1 answer
  • Hi<br>is it right?<br>"I think there is a small mistake in the quotation(second not first)"​
    5·1 answer
  • ILL GIVE BRAINLIEST TO FIRST ANSWER David is adopting an iOS app from a non-retina screen to a retina screen. The app currently
    13·1 answer
  • Nick is moving from Alabama to Texas. A friend of his remarked that Nick may have to pay higher taxes there. What is the cheapes
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!