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
elena-s [515]
2 years ago
8

Take values of length and breadth of a rectangle from the user and check if it is square or not.

Computers and Technology
2 answers:
Elanso [62]2 years ago
7 0

Answer:

Since someone else answered in python, I will answer in c++

The complete program written in C++ is as follows:

int length;

int width;

cout << "Length: ";

cin >> length;

cout << "Width: ";

cin >> width;

if (length == width) {

 cout << "Square";

} else {

 cout << "Rectangle";

}

Alecsey [184]2 years ago
5 0

The program is a conditional program, and it requires an if statement

<h3>The program in Python</h3>

The complete program written in Python is as follows:

length = int(input("Length: "))

width = int(input("Width: "))

if length == width:

  print("Square")

else:

  print("Rectangle")

Read more about Python programs at:

brainly.com/question/24833629

#SPJ1

You might be interested in
Suppose you are organizing a party for a large group of your friends. Your friends are pretty opinionated, though, and you don't
Iteru [2.4K]

Answer:

Relative greedy algorithm is not optimal

Explanation:

Proving that Relative’s greedy algorithm is not optimal.

This can be further proved by the following example.

Let us assumethe friends to be invited be Ali, Bill, David, Dennis, Grace, Eemi, and Sam.

The enemy list of each friend is shown below:

• Ali: Bill. David, Dennis

• Bill: Ali, Grace, Eemi, Sam

• David: Ali, Grace, Eemi, Sam

• Dennis: Ali, Grace, Eemi, Sam

• Grace: Bill. David, Dennis. Eemi . Sam

• Eemi: Bill, David, Dennis, Grace, Sam

• Sam: Bill, David, Dennis, Eemi, Grace

From the enemy list, the one with fewer enemies is Ali.

If we invite Ali, then Bill, David, and Dennis cannot be invited.

Next person that can be invited is one from Grace, Eemi, and Sam

If we choose any one of them we cannot add any other person.

For example, if we choose Grace, all other members are enemies of Ali and Grace. So only Ali

and Grace can only be invited.

So we get a list of two members using relative’s greedy algorithm.

This is not the optimal solution.

The optimal solution is a list of 3 members

• Bill, David, and Dennis can be invited to the party.

Hence, it is proved that relative’s greedy algorithm is not optimal, where the maximum number of friends is not invited to the party.

3 0
4 years ago
Which of the following best describes a computer virus? another name for a software bug the product of a computer crash software
nikdorinn [45]
A computer virus is software that can spread itself
8 0
4 years ago
Read 2 more answers
When are numbered lists generally used
tatuchka [14]

C. When listing items that have an order of priority.

Explanation:

There are a lot of ways to list items such as alphabets and Roman numerals.

And the all have their respective reasons.

When numbering in order of priority, it is more appropriate to use numbers instead of alphabets and Roman numerals.

8 0
3 years ago
Air bags expand at up to __________ mph. A. 70 B. 100 C. 150 D. 200
almond37 [142]
Airbags expand
D. 200 mph
7 0
3 years ago
Arrange the steps of the basic decision-making process in the correct order.
Maru [420]
Identify, gather information, identify any alternatives, weigh the evidence, choose among alternatives, take action, review you decision 
8 0
3 years ago
Read 2 more answers
Other questions:
  • An engineer is assigned to replace an older data-grade autonomous wireless network with a cisco controllerbased wireless network
    6·1 answer
  • How do I turn of the noise canceling feature on my beats studio wireless?
    13·1 answer
  • A ___________ lists all possible packet switches and gives a next hop for each.
    12·1 answer
  • which of the following can be considered a manual control switch a toggle switch a safety switch a drum switch or all of the abo
    9·1 answer
  • What data unit is addressed based on the IP address of the recipient?
    8·1 answer
  • One of the prominent movies released in the 1950s is
    15·2 answers
  • When does MMF2 inactivate an Active object? A. When the score is higher than the game's previous high score B. When the player d
    15·1 answer
  • Because a chart is _______, it can be dragged to another area of the worksheet.
    13·1 answer
  • The derivative of <br><img src="https://tex.z-dn.net/?f=ln%20%5C%3A%20%20%7Cx%7C%20" id="TexFormula1" title="ln \: |x| " alt="l
    7·2 answers
  • What is the minimum amount of hard drive space required for a 64-bit Windows 10 installation?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!