All pastes #733399 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-11 19:44 UTC
rendered paste body
#include <iostream>

using namespace std;

int main()
{
	int n;
	int n1=-1;
	int i;
		
	cout << "Enter an integer: "; 
	cin >> n;
	if (n == 1)
	{
		cout << "Neither Prime or Not Prime" << endl;	
	}
	else
	{
		for (i=2; i<n; i++)
		{
			if ((n%i) == 0)
			{
				n1 = i;
			}
		}
	
		
		if (n1 < 0)
		{	
			cout << "Prime" << endl;
		}
		else
		{
			cout << "Not Prime" << endl;
		}
	}
		
	cout << endl;
	cout << endl;
	cout << endl;
	
	
	
	return 0;
}