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
Print a message telling a user to press the letterToQuit key numPresses times to quit. End with newline. Ex: If letterToQuit = '
LekaFEV [45]

Answer:

#include <stdio.h>

int main(void) {

char letterToQuit = '?';

int numPresses = 0;

printf("Press the %c key %d times to quit ", letterToQuit, numPresses);

return 0;}

Explanation:

in print statement %c is replaced by value of  variable 'letterToQuit'and %d is replaced by value of variable 'numPresses'

3 0
3 years ago
E. what component must be compatible with every other component of the computer?
Kryger [21]
The correct answer: The motherboard 

The motherboard which is a piece of technology which has most of the electronics of a personal computer is (usually) found at the center most part of a Central Processing unit (CPU).

The motheboard needs to be compatible with all the components found in the Central Processing Unit because almost all the important components is connected to it. Just imagine if the power which the power suppy supplies to the motherboard is inadequate due to electrical incompatibility, do you think the Central processing unit will work? It won't. As a matter of fact if you turn on the CPU, it will just switch off on itself in just a few seconds. 
8 0
3 years ago
toThePowerOf is a method that accepts two int arguments and returns the value of the first parameter raised to the power of the
inessss [21]

Answer:

cubeVolume = toThePowerOf(cubeSide, 3)

Explanation:

The function toThePowerOf, receives two int arguments say, a and b, where a is the first argument and b is the second argument as follows:

toThePowerOf(a,b)

The function returns the first argument(a) raised to the power of the second argument (b) i.e a ^ b as follows:

toThePowerOf(a, b){

return a^b

}

In the call to the function, the first argument a, is replaced with the variable cubeSide and the second argument b is replaced with the value 3.

Hence, the returned result becomes cubeSide ^ 3 which is then stored in a variable cubeVolume as follows:

cubeVolume = toThePowerOf(cubeSide, 3)

6 0
3 years ago
How does Google work, why does it work that way?
Oxana [17]

Answer:

Google uses automated programs called spiders or crawlers, just like most search engines, to help generate its search results. Google has a large index of keywords that help determine search results. ... Google uses a trademarked algorithm called PageRank, which assigns each Web page a relevancy score.

8 0
3 years ago
Read 2 more answers
Double bar graphs compare multiple what
GalinKa [24]
You would multiply by 2
7 0
3 years ago
Other questions:
  • The order in which statements are executed during a program run. Answer 1 The first part of a compound statement begins with a k
    12·1 answer
  • The ____ dialog box in windows vista appears each time a user attempts to perform an action that can be done only with administr
    12·1 answer
  • How to search multiple microsoft word documents?
    15·1 answer
  • Write a script named numberlines.py. This script creates a program listing from a source program. This script should: Prompt the
    7·1 answer
  • (BRAINLIEST QUESTION) What are some challenges that will need to be overcome in order for the Internet of Vehicles to become a r
    13·1 answer
  • Hurry im TIMED
    8·1 answer
  • JPG is considered a lossy file format. What does this mean?
    15·2 answers
  • Arrange the computers in the order fastest to slowest: Minicomputer, Supercomputer, Personal Computer and Mainframe.
    9·1 answer
  • You've just received an email message that indicates a new serious malicious code threat is spreading across the internet. The m
    10·1 answer
  • !!! PLEASE HELP ASAP REALLY NEED IT !!!
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!