Friday 31 August 2012

prime number in cpp | using Flag | Prime number code

c++ prime number program source code

void main()
{
int n,i,flag=0;
clrscr();
cout<<"enter the number=";
cin>>n;
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
flag=1;
break;
}
}
if(flag==0)
cout<<"number is prime number=";
else
cout<<" number is not prime =";
}
c++ prime number program source code
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: