//PROGRAM TO FIND WEATHER THE NUMBER IS PRIME NUMBER OR NOT
/*MADE BY KRISHNA AGARWAL*/
#include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"enter the number\n";
cin>>n;
for(i=2;i<n;i++)
{
if(n%i==0)
break;
}
if(i==n)
cout<<"\nthe number is prime";
else
cout<<"\n number is not prime";
return 0;
}
/*MADE BY KRISHNA AGARWAL*/
#include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"enter the number\n";
cin>>n;
for(i=2;i<n;i++)
{
if(n%i==0)
break;
}
if(i==n)
cout<<"\nthe number is prime";
else
cout<<"\n number is not prime";
return 0;
}
No comments:
Post a Comment