prime numberes by using recusion function
I Write program print prime number between tow number but I have problem when I run it
please help me
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include<iostream>
using namespace std;
void prime(int m, int n){
int p =0;
for(int i=m; i<n; i++)
{
for (int i=1; i<m; i++)
{
if(i %m==0)
p=p+1;
}
if(p=2)
cout <<m <<endl;
}
}
int main()
{
int m, n;
cout <<"enter two numbers"<<endl;
cin>>m>>n;
prime(m, n);
return 0;
}
|
Topic archived. No new replies allowed.