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
The creation of MySpace pages by candidates in the 2008 Presidential Election is an example of the use of ___________________ to
jarptica [38.1K]
This is descriptive of the use of mass media.
7 0
3 years ago
Anyone have the Dell xps 13 laptop? if not pls don't answer but if you do, how is it going for you?​
Nady [450]

I do and it’s going alright; would recommend. Here’s what I think in bullet points.

- Good aesthetic design. Weave-like texture is nice and somewhat opulent.

- Good performance; you can overclock the i7 CPU.

- Battery life is at the upper end of the spectrum.

- No USB Type A Ports, big downside.

- Graphics are about 1000 points above industry average (3D Mark Fire Spark)

- Uses an SSD rather than a HDD; much quicker load time.

- I’d go for the $1,899 personally; it’s worth the extra money.

Thanks.

3 0
2 years ago
Read 2 more answers
Will mark brainlyist. please help
Alex73 [517]

Answer:

Sensitivity

Explanation:

He is most likely going into sensitivity because he is trying to send a private message.

4 0
3 years ago
Which type of software is primarily used to organize a collection of information for easy access?
weeeeeb [17]
Database - you could also use a spreadsheet but you can't ask questions that you can with a database
4 0
3 years ago
Please help meh T^T Which of the following describes an application error? Select 2 options.
Lena [83]

Answer:

"Every time you try to run your new game, it crashes after displaying the opening screen"

"After a recent Windows update, you can no longer access the internet on your laptop"

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • This question involves the implementation of the PasswordGenerator class, which generates strings containing initial passwords f
    5·1 answer
  • Which of the following statements most accurately describes the difference between aptitudes and skills?
    8·1 answer
  • "If someone really wants to get at the information, it is not difficult if they can gain physical access to the computer or hard
    11·1 answer
  • Someone asks you for help with a computer that hangs at odd times. You turn it on and work for about 15 minutes, and then the co
    7·1 answer
  • What is the unit used to describe the intensity of sound?
    5·1 answer
  • Express 0.0005 x 10-4 farads as picofarads
    5·2 answers
  • Microsoft Excel is an example of a(n) application.
    11·2 answers
  • Write a program to implement problem statement below; provide the menu for input N and number of experiment M to calculate avera
    9·1 answer
  • Technology has had
    10·1 answer
  • How can you remove background noise from a video?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!