Write a program in c++ to print the prime no. Between
Answers
Answered by
0
#include<bits/stdc++.h>
using namespace std;
check isprime#include<bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
for(int i=2;i<=sqrt(n);i++)
{
if(n%i==0)
return false;
}
return true;
}
int main()
{
int l,r;
l = 5;
r = 10000;//Range
for(int i=l;i<=r;i++)
{
if(isPrime(i))
{
cout<<i<<endl;
}
}
}
(int n
Similar questions