Simple if program

This program simply states whether a number is positive, negative, or zero. However, after inputting a number nothing happens. It must be something stupid I'm missing, but I can't spot it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	double number;

	cout << "This program will declare your number to be positive, negative or zero." << endl << endl;
	cout << "Please type input your number." << endl;
	cin >> number;
	cout << endl;

	if (number < 0)
		cout << "Your number is negagtive." << endl;
	if (number = 0)
		cout << "Your number is zero." << endl;
	if (number > 0)
		cout << "Your number is positive." << endl;

	cout << endl;
}
closed account (j3Rz8vqX)
The second "if-condition" wants an equality operator?

"=="

not

"="//assignment operator.
Of course, thank you!
Topic archived. No new replies allowed.