and then generate the primes between these numbers and output it on screen
and i must use a void function as our doctor say unless i will lose marks
i could not make the function void so i made it return function
and after i wrote the program i discovered that the program work correctly but it is output the primes and after the primes directly output " 1 "
so i have two problems the first that i must convert the function to void
and the second is i want to remove the " 1 " which make me crazy because its appear in every output and i hope you help me guys , this is the program :
#include<iostream>
#include<cmath>
using namespace std;
printPrimes ( int, int);
int main()
{
int num,num2;
cout<<"Enter The First Number:"<<endl;
cin>>num;
cout<<"Enter The Second Number:"<<endl;
cin>>num2;
while (num>=num2)
{
cout<<"The First Number Should Be smaller Than The Second Number"<<endl;
cout<<endl;
cout<<"Enter The First Number"<<endl;
cin>>num;
cout<<"Enter The Second Number"<<endl;
cin>>num2;
}
cout<<"The Primes Between The First Number and The Second Number are"<<endl;