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
What are all the physical components called?
Alecsey [184]

Physical Components to a computer are called hardware.

3 0
3 years ago
Look at the following code.int x = 7;int *iptr = &amp;x;What will be displayed if you send the expression *iptr to cout ? What h
masha68 [24]

Answer:

The answer to the given question can be given as:

The value of *iptr is 7. and the value of iptr is dynamic.

Explanation:

In the c++ code, it is defined that x is an integer variable that assigns a value which is 7. Then we define a pointer variable that is *iptr. This variable holds an address of the x variable. When we print the value of the iptr variable. if we use the expression *iptr to print value of the pointer variable by cout that is used in c++ for pint values. so the value of the iptr is 7. If we use the expression iptr sent to cout so we show the address of the variable x. In the pointer, it manages the addresses of dynamically allocated so the address of the variable is changed on execution time.

4 0
3 years ago
Components of an operating system include process,memory,and file management. what is another component of and operating system
kirza4 [7]

Answer:

Wrong it's actually C.

Explanation:

APEX

4 0
2 years ago
Read 2 more answers
The CPU's control unit retrieves the next instruction in a sequence of program instructions from main memory in the ______ stage
Varvara68 [4.7K]

Answer:

A. Fetch.

Explanation:

The fetch-decode-execute process of simply the fetch-execute process of the CPU are stages the CPU follow to process information and the switch state or shutdown.

The stages of this process is implied in its name, that is, the stages are fetch, decide and execute.

The fetch stage retrieves the next instruction from the memory.

The decode stage converts the clear text instruction set to electronic signals and transfer it to the appropriate registers.

The execute stage is the action carried out in the arithmetic logic unit.

5 0
3 years ago
Write an example method that overrides the operator to create a new book whose title is a concatenation of the titles of two boo
Anastasy [175]

next time m8 mmmmmdsaasd

5 0
3 years ago
Other questions:
  • Choose all statements that identify the benefits of programming design.
    10·2 answers
  • Hudson has to maintain confidential college data in a workbook. He needs two team members to help him update data in the specifi
    7·2 answers
  • A loop that repeats a specific number of times is known as a(n):
    9·1 answer
  • Which of the following STEM discoverers is known for creating complex computational physics to develop computer models to simula
    7·1 answer
  • What shortcut keys do i use to print something on my keyboard ?
    6·2 answers
  • Instructions:Select the correct answer.
    9·1 answer
  • For each of the following application areas state whether or not the tree data structure appears to be a good fit for use as a s
    8·1 answer
  • How did hitles rules in nazi germany exemplify totiltarian rule?
    10·1 answer
  • What is meant by the term text?
    14·2 answers
  • Write a program that generates 100 random numbers and keeps a count of how many of those random numbers are even and how many of
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!