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]
4 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]4 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
Write the prototype for a function named showSeatingChart that will accept the following two-dimensional array as an argument. c
barxatty [35]

Answer:

See explaination

Explanation:

void showSeatingChart(string seatingChart[20][40], const int ROWS, const int COLS){

for(int i = 0;i<ROWS;i++){

for(int j = 0;j<COLS;j++){

cout<<seatingChart[i][j]<<" ";

}

cout<<endl;

}

}

4 0
3 years ago
Pls can anyone be so kind and answer this question.....i need the answer urgently
mixas84 [53]

Answer:

so u have to be smaet

Explanation:

8 0
3 years ago
Which programming model is distinct from the others discussed because it focuses on the data, or object, rather than the logic,
DIA [1.3K]
The programming model that is distinct from the others discussed because it focuses on the data, or object, rather than the logic, or function is object-oriented programming.
4 0
3 years ago
On the 80x86 CPU, the ESP register keeps track of the value on the top of the runtime stack.
Ronch [10]

Answer:

True

Explanation:

The ESP register acts as an indirect operand pointing to the top of the stack at any time.

Stack grows downwards from high memory when a program adds to the stack. However, when items are removed from the stack, it shrinks upwards from low to high memory.

The assembler reduces the stack pointer(ESP) register by 2, when a word value is pushed on to the stack. On the other hand, the assembler increases the stack pointer by 2 when a word value is popped off.

The assembler decreases or increases the ESP register by 4 when a double word value is pushed or popped off the stack respectively. Therefore the ESP register changes in multiples of 4.

8 0
3 years ago
You are a computer Tech. You have been asked to solve a computer problem. The office manager says his computer not working corre
Nat2105 [25]

Answer:

1. Reboot computer .

2. If the issue persists, check if antivirus software is updated; if so, then verify if the problem is only with Office suite, try to save another Word, Excel, Power Point document and running other programs. If the problem is also extended to Excel or Power Point and other programs run properly then:

a. Uninstall Office Suite (documents and information won´t be lost)

b. Reinstall Office Suite  

c.      Run Word, Excel, etc.

Word documents should open properly.

Explanation:

The above procedure should solve the problem given that it was verified and discarded that the malfunction was caused by a virus and upon verifying that the problem was not only with Word, but all applications related to Office Suite, then by reinstalling the software any malfunction could be fixed.

7 0
4 years ago
Read 2 more answers
Other questions:
  • Which network component connects a device with the transmission media and allows it to send?
    7·1 answer
  • When the tcp\ip translates a network layer address into a data link layer address (after not finding an entry for the network la
    13·1 answer
  • What component can be used for user input or display of output?
    8·1 answer
  • jakie krasnale mieszkaja we wroclawiu i opisz kto napisal kronike, prosze nie kopiowac dlugich tekstow najlepiej by bylo opisac
    6·1 answer
  • The list of abbreviations, punctuation, symbols, typefaces, and instructional notes that appears at the beginning of the ICD and
    5·1 answer
  • What is the fifth and final stage in the process of media production
    13·1 answer
  • What are the origins of the parking barrier?
    12·1 answer
  • HELP PLS QUICK TRUE OR FALSE QUESTION
    7·2 answers
  • Stacy plans to print her contacts and would like to choose an option that will print select information for each contact in a bu
    12·1 answer
  • You are the Emergency Management Director of a small island nation. Your nation has come under Cyber-attack and the attackers ha
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!