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
Which tab of the ribbon includes the links group for creating hyperlinks or internal references?
Deffense [45]
The correct answer is D.File
5 0
3 years ago
Read 2 more answers
Write a recursive method called repeat that accepts a string s and an integer n as parameters and that returns s concatenated to
svp [43]

Answer:

public static String repeat(String text, int repeatCount) {

   if(repeatCount < 0) {

       throw new IllegalArgumentException("repeat count should be either 0 or a positive value");

   }

   if(repeatCount == 0) {

       return "";

   } else {

       return text + repeat(text, repeatCount-1);

   }

}

Explanation:

Here repeatCount is an int value.

at first we will check if repeatCount is non negative number and if it is code will throw exception.

If the value is 0 then we will return ""

If the value is >0 then recursive function is called again untill the repeatCount value is 0.

6 0
3 years ago
A file manager is used for all of the following except ____. A. to move files and folders B. to reorder files and folders C. to
Alex73 [517]

Answer:

A .to move files and folders

5 0
3 years ago
Read 2 more answers
What is the best way to study for an exam?
cupoosta [38]

AnswerB

Explanation:Makes since to look over the notes each night before the exam

8 0
2 years ago
Kyle is running out of disk space on his hard drive on a Windows XP Professional system. He has installed and configured a third
Varvara68 [4.7K]

Answer:

The answer is "Disk utility".

Explanation:

It'll work well go over to Disk utility before updating the drivers like diskmgmt.msc throughout the Running box, or right-click Device icon, and pick Manage. Click Rescan Disks on the key decision-makers. It's not essential to reconnect until the machine recognizes the latest disc.

  • In each disc setup as storage properties is a reactive drive. Almost every dynamic disk is separated into quantities.
  • It is the season, spanned, and strip volume forms will be included.
5 0
2 years ago
Read 2 more answers
Other questions:
  • Which can be inserted using the insert panel in dreamweaver cc?
    9·1 answer
  • Find the word-length 2's complement representation of each of the following decimal numbers:a. 845b. 15000c. 100d. -923
    8·2 answers
  • Which part of project management involves determining the required materials?
    14·2 answers
  • The most basic software required for an online course where writing is involved is:
    13·1 answer
  • High level languages are closer to machine language than humans yes or no​
    12·2 answers
  • Which symbol would be used in a flowchart to represent a connection to another part of the flowchart
    5·1 answer
  • How can you have internet without subscribing to cable?
    13·1 answer
  • We need goku and naruto fight story someone
    11·2 answers
  • Terri needs to insert a cover page into her document. Where should she go to access the commands to do so? Insert tab, Objects g
    14·1 answer
  • Various types of mouse pointer<br>​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!