if loop example


/if loop examples

#include <iostream>

using namespace std;


int main()
{
	int x;

	// get user input	
	cout << "\nEnter a number between 1 and 1000\n";
	cin  >> x;									

	//run the test
	if (x>500)
	{
		cout << "Your number is greater than 500!\n";
	}

	if (x < 500)
	{
		cout << "\nYour number is less than 500!\n";
	}

	if (x ==500)		//note the double equal signs!
	{
		cout << "\nYour number is exactly 500!\n\n";
	}


	return 0;
}	// end of main