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
Sergio [31]
3 years ago
10

Write a program that prompts the user to input a number. The program should then output the number and a message saying whether

the number is positive, negative, or zero.
Computers and Technology
1 answer:
Gala2k [10]3 years ago
7 0

Answer:

Following is the program in C++ Language

#include <iostream> // header file

using namespace std; // namespace std

int main() // main method

{

   int n;  // variable declaration

   cout<<" Please enter the number :";

   cin>>n; // Read the number

   if(n>0) // check the condition when number is positive

   {

cout<<n<<endl<<"The number is Positive"; // Display number

   }

  else if(n<0) // check the condition when number is Negative

  {

cout<<n<<endl<<"The number is Negative";// Display number

  }

  else // check the condition when number is Zero

  {

cout<<n<<endl<<"The number is Zero";// Display number

  }

   return 0;

  }

Output:

Please enter the number:

64

The number is Positive

Explanation:

Following are the description of the program

  • Declared a variable "n" of int type.
  • Read the value of "n" by user.
  • Check the condition of positive number by using if block statement .If n>0 it print the number is positive.
  • Check the condition of negative number by using else if block statement If n<0 it print the number is negative.
  • Finally if both the above condition is fail it print the message " The number is Zero"

You might be interested in
Which of the following is a valid formula?<br> (C2-D16)<br> O A2/F2<br> O=B5/10<br> O =E10
dmitriy555 [2]

Answer:

=B5/10

=E10

Explanation:

The above two formulas are the correct options. Remember for a valid formula in Excel, we must have the = sign first, and this should be followed by a valid formula. Saying that C5 should be E10 by writing =E10 at C5 is a formula certainly. And storing B5/10 at C5, through =B5/10 is also a valid formula. Hence, two formula out of four, and as mentioned above are the correct ones.

4 0
3 years ago
Anil needs to show the overlap of people who live in a certain neighborhood in his city and who support a specific political can
pantera1 [17]

Since Anil needs to show the overlap of people who live in a certain neighborhood in his city that supports a specific political candidate, the type of conceptual diagram which he should use is a: B: Venn diagram.

<h3>What is a Venn diagram?</h3>

A Venn diagram can be defined as a circular graphical (visual) tool that is typically used for representing, logically comparing and contrasting two (2) or more finite sets of data such as objects, students, events, voters, concepts, people, etc.

In this context, we can reasonably infer and logically deduce that a Venn diagram is a type of conceptual diagram which can be used by Anil in illustrating the overlap of people who are living in a certain neighborhood in his city and supports a specific political candidate in an election.

Read more on Venn diagram here: brainly.com/question/24581814

#SPJ1

8 0
1 year ago
What are some areas to fill out in the New Formatting Rule dialog box? Check all that apply. rule type function name condition c
spayn [35]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

In this question the given options are:

  1. rule type
  2. function name
  3. condition
  4. cell reference
  5. argument
  6. format

<u>The correct options to this question are:</u>

1. rule type  

3. condition

6.  format

These are the areas that can be used to fill out in the New Formatting Rule dialog box. Other options are not correct becuase these are not used to fill out new formatting rule dialog box.

6 0
3 years ago
Read 2 more answers
It is not free to manage the settings of your wiki (true or false)​
jek_recluse [69]

Answer:

shuush

Explanation:

u r a shmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaak

5 0
3 years ago
6. When adjusting the bounding box around text, hold the key to scale
katrin2010 [14]

Answer:

What are the answers?

Explanation:

5 0
3 years ago
Other questions:
  • Nathan notices his computer System is slowing down when he tries to copy documents to it he also gets a prompt I warned him that
    7·1 answer
  • Two electronics technicians are discussing electrical quantities. Technician A says that resistance is an opposition to electric
    6·1 answer
  • The software application associated with a specific file type is called a(n) __________ application.
    12·1 answer
  • For the following scenario, indicate whether the action is a good practice or bad practice for safeguarding your personally iden
    6·1 answer
  • What is hardware?
    10·1 answer
  • Algoritmos para llevar a cabo una actividad
    15·1 answer
  • HTML, the markup language of the web, specifies colors using the RGB model. It uses a two-digit hexadecimal (that is, base 16) r
    13·1 answer
  • Savings accounts _____.
    15·1 answer
  • POR FAVOR AYUDENME DIGAN SOLO 10 Ejemplos de Software de Sistema. SI NO REPRUEBO Y LE DOY CORONA
    14·2 answers
  • Majken is turning 18 years old soon and wants to calculate how many seconds she will have been alive.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!