All pastes #296734 Raw Edit

prDetector

public cpp v1 · immutable
#296734 ·published 2006-12-30 14:23 UTC
rendered paste body
/*Program: Prime No. Detector.Description: Dectects prime No. in a specified range of numbers.Author: Metal_Creation Date: 16/12/2006*/#include <iostream.h>int main(){	int eNum;	bool status=true;	cout <<"Welcome to Prime No. Detector v.1.0 Beta\n";	cout <<"Enter the ending number:\n";    cin >>eNum;		for(int i=3;i<=eNum;i++)		{			 for(int p=2;p<i;p++)			 {  				if(i%p==0)				{					status=false;					break;				}			 }			  if (status)			  {			 	cout <<i <<endl;			  }		    status=true;}		return 0;}