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
Write a multi-threaded program that outputs prime numbers. The program should work as follows: the user will run the program and
Ierofanga [76]

Answer:

The programming code can be found in the explanation part, please go through it.

Explanation:

Code:

#include<stdio.h>

#include<stdlib.h>

#include <pthread.h>

// function check whether a number

// is prime or not

int isPrime(int n)

{

// Corner case

if (n <= 1)

return 0;

// Check from 2 to n-1

for (int i = 2; i < n; i++)

if (n % i == 0)

return 0;

return 1;

}

void* printPrimes(void *vargp)

{

int *n = (int *)vargp;

int i=0;

for (i=2;i<=n;i++)

{

if (isPrime(i)) printf("%d\n", i);

}

}

// Driver Program

int main(int argc, char* argv[])

{

int n = atoi(argv[1]);

pthread_t tid;

pthread_create(&tid, NULL, printPrimes, (void *)n);

pthread_exit(NULL);

return 0;

}

4 0
3 years ago
COULD U ANSWER THIS ???
vladimir1956 [14]

Answer:

B.lightning striking a tree

Explanation:

The crowd dispersing in all directions is not a closed-loop by any means, and students jogging around an oval track as well is not a closed-loop, and also not a cross country run from one point to another. However, the lightning striking a tree is a closed loop that best models a circuit. And as lightning strikes the tree, like a closed circuit, tree catches the fire, or in circuitry words, the current is generated, and tree catches the fire due to it, just like bulb starts glowing.

3 0
3 years ago
It is important to analyze the sources and uses of cash because:___.
sergey [27]

It is important to analyze the sources and uses of cash because creditors use this information to assist them in deciding whether to loan funds to them. Investors use this information to decide if they will purchase their stock.

Managing your revenue is an important step to starting or investing in something.

Creditors always check and properly analyze the sources of cash before providing a loan to a lender. They do not invest in companies or people who are least likely to source and make cash in the coming time. Hence, your sources and uses shall be properly analyzed when presenting to creditors.

Investors, whenever investing in something will look at the benefits of the source they want to invest into. If a source is not likely to produce beneficiary revenue in the upcoming time, then investors will never invest in such a kind of source.

To learn more about investors, click here:

brainly.com/question/25311149

#SPJ4

5 0
2 years ago
Which process best describes how you might prepare to apply for a job?
saveliy_v [14]
Take an online course,or maybe do special trainings,practice and study.
8 0
3 years ago
Read 2 more answers
Which part of the cerebrum is associated with hearing and memory?
Brut [27]
I'm pretty sure it's the frontal lobe
4 0
3 years ago
Read 2 more answers
Other questions:
  • _______________ is used by a hacker to mask intrusion and obtain administrator permissions to a computer.
    7·1 answer
  • List the steps that you need to locate Microsoft Word on your computer
    7·1 answer
  • Select the correct answer.
    6·1 answer
  • How do functions work ? Functions use and operators ,perform calculations , and return a .
    13·1 answer
  • HELP WILL MARK BRAINLIEST!!!!!!!!!!!!!!!!!<br> How do you take a screenshot on Windows 7?
    15·2 answers
  • On a rheostat the first terminal is connected to a
    14·1 answer
  • Selecting missing puppies 1 # Select the dogs where Age is greater than 2 2 greater_than_2 = mpr [mpr. Age &gt; 2] 3 print(great
    8·1 answer
  • What is MVC architecture in relation to developing in web applications? How
    6·1 answer
  • You are working with an older relative who is writing their last will and testament and you two are sharing the document back an
    11·1 answer
  • Hosts on the Internet have ________ addresses. Group of answer choices both A and B neither A nor B IP data link
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!