How to 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.
Save as Number.cpp
Which aspect, specifically, are you having trouble with?
Also, you waited 2 whole minutes before bumping your thread? Seriously? You need to be more patient. You're very unlikely to get an immediate answer to anything here. People come here in their spare time, and answer threads as and when they choose.
#include <iostream>
usingnamespace std;
int main ()
{
int number = 0;
cout << "Enter a number: ";
cin >> number;
if (number == 0)
cout << "Number is zero";
elseif (number < 0)
cout << "Number is less than zero";
else
cout << "Number is greater than zero";
return 0;
}