0

How to print prime numbers in a range between any two numbers using recursion?

I wrote a program that prints prime number in a range between two numbers. But I have an error when I run it. I want the output to look like 2,3,7,9. What should I change to fix it? #include <iostream> using namespace std; void prime( int m, int n){ 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; } } }

21st Feb 2017, 6:36 PM
Mohamed Abdalla
Mohamed Abdalla - avatar
1 Answer
0
I am waiting your answers
21st Feb 2017, 10:16 PM
Mohamed Abdalla
Mohamed Abdalla - avatar