Subscribe to Feeds

Send Your COMPLETED Projects To georgepj@hotmail.com

We'll Publish It With Your Name :-)

Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]

Sum of Prime Nos

Click Here To Download C++ File Of This Program

 //Downloaded From www.c4cpp.co.nr. (C)2009.All rights reserved.  
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int p=0,i,n;
cout<<"Enter the no :"<<endl;
cin>>n;
for(i=2;i<=(n/2);i++)
{
if(n%i==0)
p=1;
}
if(p==0)
cout<<"Prime";
else if (p==1)
cout<<"Not Prime";
getch();
}

No comments: