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
A typical day in programming and software development would involve
mrs_skeptik [129]

Answer:

writing code for a software program.

Explanation:

Software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications.

Some of the models used in the software development life cycle (SDLC) are; waterfall model, incremental model, spiral model, agile model, big bang model, and V-shaped model.

The five (5) standard stages of development in software development are;

I. Analysis.

II. Design.

III. Implementation (coding).

IV. Testing.

V. Maintenance.

A typical day in programming and software development would involve writing code for a software program.

Generally, software applications or programs require a code containing series of sequential instruction to perform specific tasks, commands and processes. These sets of code are typically written by a software developer (programmer).

3 0
3 years ago
The part of the computer that provides access to the internet is the
Arlecino [84]
<span>The part of the computer that provides access to the internet is the "modem".
</span>

A modem refers to a hardware device that enables a PC to send and get information over a phone line or a link or satellite association. On account of transmission over a simple phone line, which was at one time the most prevalent approach to get to the internet, the modem changes over information amongst simple and computerized designs progressively for two-way network communication.
4 0
2 years ago
Read 2 more answers
Automatic red-eye reduction settings work best on which type of flash?
zhuklara [117]

Answer:

c

Explanation:

3 0
2 years ago
In spreadsheet software, use ____ to create meaningful data summaries to analyze worksheets containing large volumes of data.
morpeh [17]
<span>In spreadsheet software, use pivot tables to create meaningful data summaries to analyze worksheets containing large volumes of data.</span>
6 0
3 years ago
Why is the choice of form factor critical when building a computer from scratch?
faltersainse [42]
More features/more space makes things easier to work on and cool down
6 0
2 years ago
Other questions:
  • Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from great
    8·1 answer
  • How will you identify a file type on your computer? A file type is the standard used to and information in a computer. All file
    14·2 answers
  • Electricity is moved from place to place a long __________​
    14·2 answers
  • Which industry has the highest employment figure for both teen and young adults in July, 2014?
    6·1 answer
  • Implement RandMultipByVal function, which gets one integervariable as its argument
    12·1 answer
  • Which option is available when reviewing changes and using the Accept command in the Compare group?
    10·2 answers
  • Kitchen Gadgets
    10·1 answer
  • A computer on a network that is not the server​
    15·1 answer
  • Is y0utube an example of unsupervised learning or supervised learning?
    13·1 answer
  • CODEHS: WHY is it important to know the difference between div and span?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!