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]
4 years ago
12

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

Computers and Technology
1 answer:
bixtya [17]4 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
Code written by computer programmers is translated to binary code, so computers can understand the instructions. True or False
san4es73 [151]

Answer:

True

Explanation:

High-level languages such as Java, C++, Ruby, Python, etc need to be translated into binary code so a computer can understand it, compile and execute them.

Machine language is the only language that is directly understood by the computer because it is written in binary code. But writing codes in Machine Language is tiring, tedious, and obsolete as no one really uses it anymore.

7 0
3 years ago
Array elements are differentiated because each has a unique: O A) Range O B) Data Type o c) Index O D) Value
Hoochie [10]

Answer

The correct answer is option(C) which is "Index".

Explanation:

Array elements can be differentiated because each element in the array have different index value.In the array all elements are of same data type, so we can not differentiated them on the basis of data type. Also an array can have same value many times, That is why we can not differentiated them on this basis. In the array elements are from any range, so its not possible to distinguish them on range. We can only distinguish elements of an array on their index value because each element have different index in the array.

7 0
3 years ago
Define Technology. Explain the term.​
aleksandrvk [35]

Answer:

Technology refers to methods, systems, and devices which are the result of scientific knowledge being used for practical purposes. Technology is changing fast. They should be allowed to wait for cheaper technologies to be developed.

7 0
3 years ago
Read 2 more answers
Create a loop that will output all the numbers less than 200 that are evenly divisible (meaning remainder is zero) by both 5 and
Readme [11.4K]

Answer:

public class num7 {

   public static void main(String[] args) {

       int n =1;

       while(n<200){

           if(n%5==0 && n%7==0){

               System.out.print(n);

               System.out.print(",");

           }

           n++;

       }

   }

}

Explanation:

  • In Java programming Language
  • Create and initialize an int variable (n=1)
  • Create a while loop with the condition while (n<200)
  • Within the while loop use the modulo operator % to check for divisibility by 5 and 7
  • Print the numbers divisible by 5 and 7
4 0
3 years ago
What is the default left margin in word 2003 document ?
forsale [732]

Answer:

1.25 inches

Explanation:

It is 1.25 inches or 3.17 cm which is the left and right margin in the " Word 2003 document". And 1 inch or the 2.54 cm is being set as both sides left and right standard margin and 1.25 inches are also set for the top and bottom margin in the "Word 2003 document". And hence, by default, the left margin in Word 2003 document happens to be 1.25 inches.

8 0
3 years ago
Other questions:
  • Charles sends Julia text messages every morning insulting her appearance and threatening to hurt her. He writes unflattering des
    5·2 answers
  • The leading membranophone in "Kan andi ghazal" is the ________. (If you can not access the audio file here, please go to modules
    11·1 answer
  • Which device uses radio waves? ceiling fan microwave oven air conditioner x-ray machine?
    7·1 answer
  • I am buying a BluRay drive access time is 180ms and the other is 210ms(BD-ROM) whats does access time mean
    5·1 answer
  • What is the value of the variable named result after the following code executes? var X = 5; var Y = 3; var Z = 2; var result =
    14·1 answer
  • Which of the following is not considered format?
    8·2 answers
  • What is the value stored at x, given the statements:
    11·1 answer
  • Not all hardware is connected with wires, some hardware might be connected wirelessly with
    9·1 answer
  • Under which menu option of a word processing program does a star appear?
    9·1 answer
  • Write a program that prompts the user to enter a fraction in the following format (x/y). You may assume that the user will input
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!