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
Kumar was working on his term paper and had not saved his work before the battery died on his laptop. He panics because the pape
Nina [5.8K]

Answer:

By presuming Kumar was working on his term paper using Microsoft Word, he can be advised to restore the unsaved document using the Recover Unsaved Documents feature in Word.

Explanation:

Firstly, Kumar can click File tab in Word and click Manage Document. Kumar shall find the option Recover Unsaved Documents from a drop down list and he can click it as his option. At this stage, Kumar shall see the missing files in the dialog box. The recent loss file shall appear in the dialog box. Just open the desired document and save it.

4 0
3 years ago
The set of instructions that tell the computer what to do are called ____.
CaHeK987 [17]
Hi,

The word you are looking for is "programs".

Hope this helps.
r3t40
4 0
3 years ago
Read 2 more answers
Who do u play as in sister location
seropon [69]
Well, it really depends on who you believe, because i have a lot of friends who say it is Purple Guy, but i have others that say you just play as an unknown character. So, i would go with Purple Guy, but I'm only like 85 percent sure.
5 0
3 years ago
Read 2 more answers
Create a class called Fraction. Provide a constructor that takes 2 integers. Provide methods for:
tekilochka [14]

Answer:

Explanation;

else

System.out.println("f1 and f2 are not equal");

switch (input.charAt(0)

{

case '+':

f3 = f1.add(f2);

System.out.println("f1+f2=" + f3);

break;

case '-':

f3 = f1.subtract(f2);

System.out.println("f1-f2=" + f3);

break;

case '*':

f3 = f1.multiply(f2);

System.out.println("f1*f2="+f3);

break;

case '/':

f3 = f1.divide(f2);

System.out.println("f1/f2="+f3);

break;

default:

System.out.println("Illegal command: " + input );

break;

}

}// end of while loop

} // end of main

}

 

Note ; this is the last part of the programme check the attachment from 1-5  this is the 6th .

8 0
2 years ago
What is a characteristic of a wan hub-and-spoke topology?
olga nikolaevna [1]

The characteristic of the WAN hub and spoke topology is that it is considered to be a branch site or composed of the branch site in which they are likely to be connected to a site that is central and that is through the point to point links.

8 0
3 years ago
Other questions:
  • DJ wants to see how his document will look when printed. Where would he find the button to see the document in print view? the P
    5·2 answers
  • To create a cover letter to send to potential employers along with a resume, what software program should you use ?
    6·2 answers
  • To communicate with an expansion card, one part of the ____ bus runs between RAM and the processor; the other part runs between
    13·1 answer
  • What is the meaning of the word joystick
    6·2 answers
  • Which table attributes would this code produce?
    15·1 answer
  • Write a program "addnumbers.c" where it takes as many arguments as the user includes as command line arguments and calculates th
    11·1 answer
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • How did transistors revolutionize the world of computers?
    15·1 answer
  • Describe psychographic differences among the past five generations of Americans that you learned about in this course. What type
    5·1 answer
  • Which of the following Access objects provides a user-friendly data entry method?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!