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
trapecia [35]
3 years ago
12

Write the C++ if statement that compares the contents of the quanity variable to the number 10. If the quantity variable contain

s a number that is equal to 10, display the string "Equal". If the quantity variable contains a number that is greater than 10, display the string "Over 10". If the quantity variable contains a number that is less than 10, display the string "Not over 10".
Computers and Technology
1 answer:
Rus_ich [418]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main

{

//Declare variable quantity

int quantity;

//Accept value for Quantity

cin>>quantity;

//Compare variable quantity with 10

if(quantity == 10)

{

cout<<"Equal";

}

else if(quantity > 10)

{

cout<<"Over 10";

}

else

{

cout<<"Not over 10";

}

return 0;

}

Explanation:

The above is a full c++ Program that does executes the instructions in the question.

Lines that starts with // are comments and they are ignored during program execution.

Variable quantity was declared as integer because the number to be compared with (10), is an integer.

Before comparison, the program must accept input. This was shown with the statement "cin>>quantity;"

For each comparison statement, if it's true, the statement within the curly braces {} will be executed.

Comparison of variable quantity with 10 starts at "if(quantity == 10)"

If quantity equals 10, then "Equal" will be printed (without the quotes)

if(quantity>10) means if quantity is greater than 10 and this will print "Over 10", if it's true (without the quotes)

The last comparison statement

"else {"

This will print "Not over 10" (without the quotes) if the first 2 comparison statements are not true.

You might be interested in
How can you access the Help and Support system?
Ne4ueva [31]
By going to the person on the bottom and there should be a tab
5 0
3 years ago
Read 2 more answers
How many wins does ninja have :/
den301095 [7]

Answer:

he played 13,500 games and has 37 percent win rate

5 0
3 years ago
When you record a macro, you can assign it to run from a button or from the _____.
arsen [322]
Depends on what software you use and how you set it up. But yea it’s possible
3 0
4 years ago
Read 2 more answers
Read the following scenario, and then answer the question.
maxonik [38]

Answer:

Monitor size

Explanation:

Hope this helps

4 0
3 years ago
Read 2 more answers
Write a program that prompt the user to enter a bank balance. The balance entered by the user is read into a variable named bala
IRINA_888 [86]

Answer:

ertyuiopoijuhgfdsa hiyoufun tresdfghytrefgytredfg

Explanation:

look for the words

4 0
3 years ago
Other questions:
  • How do I give extra points on Brainly
    6·2 answers
  • Two types of business communications enhanced by desktop publishing are
    7·2 answers
  • When you add text to a slide using presentation software, which of the following is important?
    12·2 answers
  • Sukant’s professor asks her to take over his online class while he is away because she is an effective digital communicator. Whi
    11·2 answers
  • What types of storage can be used to access your data on another computer?
    7·2 answers
  • RFID tagging is an IoT technology that allows assets to be tracked using electromagnetic fields to automatically identify tagged
    10·1 answer
  • What type of system is associated with weather that has lots of clouds and thunderstorms with the possibility of tornadoes?
    10·1 answer
  • Where to get industrial circuits far cry 6
    8·1 answer
  • What type of program would you use to create a personal budget?
    15·1 answer
  • write an assembly program that uses the output compare function of a timer to toggle an led every second
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!