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
statuscvo [17]
3 years ago
12

Write a C++ programthat returns the type of a triangle (scalene, equilateral,or

Computers and Technology
1 answer:
bixtya [17]3 years ago
8 0

Answer:

#include<iostream>

using namespace std;

int main(){

   //initialize

   int a, b,c;

   //print the message

   cout<<"Enter the three sides of the triangle: "<<endl;

   //store in the variables

   cin>>a>>b>>c;

   //if-else statement for checking the conditions  

   if(a == b && b == c && a == c){

       cout<<"\nThe triangle is equilateral";

   }else if(a != b && b != c && a != c ){

       cout<<"\nThe triangle is scalene";

   }else{

       cout<<"\nThe triangle is isosceles";

   }

   return 0;

}

Explanation:

Create the main function and declare the three variables for the length of the sides of the triangle.

print the message on the screen for the user. Then the user enters the values and its store in the variables a, b, and c.

use the if-else statement for checking the conditions.

Equilateral triangle: all sides of the triangle are equal.

if condition true, print the equilateral triangle.

Scalene triangle: all sides of the triangle are not equal.

if condition true, print the Scalene triangle.

if both conditions is not true, then, the program moves to else part and print isosceles.

You might be interested in
You have been tasked with training end users in security best practices and have observed a trend among users in which many are
quester [9]

Hi, A Tech-Savvy here.

Answer:

(C) Lengthen the time period between forced password changes.

7 0
2 years ago
Suppose you're trying to remove the clamp from a ground strap that's connected to a battery. The clamp won't come loose. Which o
Mekhanik [1.2K]
The answer would be B.
5 0
3 years ago
Read 2 more answers
Which is a good example of kinetic energy
Alexandra [31]

Answer: A. Flying a paper airplane.  

5 0
3 years ago
Read 2 more answers
Synthesizing information can be done by creating
Maurinko [17]

Answer:

D

Explanation:

because you use all of those

4 0
3 years ago
Read 2 more answers
A customer reports that recently several files cannot be accessed. The service technician decides to check the hard disk status
Lyrx [107]

Answer:

Back up the user data to removable disk

Explanation:

Before you work on a computer, especially anything that has to do with files not accessible, this might need to format the system because it might either be a virus or other forms of malware. Since backup was done to a different logical partition on the disk, the first thing to do before performing any diagnostic procedures on the disk is to back up the user data to a removable disk in order not to lose the information in the system.

8 0
3 years ago
Other questions:
  • Philip is thinking about customizing his motorcycle. A paint job, saddlebags, and a radio would cost $600. His motorcycle is old
    15·2 answers
  • Suppose you were assigned to develop a logical model of the registration system at a school or college. would you be better off
    9·1 answer
  • How much health did a supply drop balloon originally have??
    7·2 answers
  • If you wish to sign out of your Microsoft account, tap or click ____ on the ribbon to open the Backstage view and then tap or cl
    8·1 answer
  • Student creates a Raptor program and uses the File Input and Output method to find the average of 5 test scores stored in a text
    5·1 answer
  • A trust domain is defined as Select one: a. The agreed upon, trusted third party b. A scenario where one user needs to validate
    5·2 answers
  • Tcp takes a three-step approach to establishing a reliable communication. first, from the transport layer of the sending device
    12·1 answer
  • 1. Which sentence best expresses the main idea
    12·1 answer
  • True or False: The major advantage of Arrays over ArrayLists in Java is the fact that while ArrayLists are fixed in size, an Arr
    15·1 answer
  • 56- What is the term used when you press and hold the left mouse key and more the mouse
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!