Answer to Question #339757 in C++ for Man

Question #339757

Write a program in c++ to check wether a number is positive, negative or zero


1
Expert's answer
2022-05-11T13:52:08-0400
#include <iostream>
using namespace std;


int main()
{
	int number;
	while (number != 999){
		cout << "Enter number (999 - exit): ";
		cin >> number;
		if (number > 0)
		   cout << "A number is pozitive" << endl;
  		else if (number < 0)
  			cout << "A number is negative" << endl;
		else
			cout << "Number is zero" << endl;
	}	
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS