eg:give 23
it will show 2,3,5,7,11,13,17,19
#include<iostream>
using namespace std;
int main()
{
int prime=2;
cout<<"Insert a number";
cin>>prime;
for(;prime>=2;prime--)
{
if( prime !=prime && prime % prime ==0)
cout<<prime<<endl;
}
system("pause");
}
hmm,anyone can give some hints to do it ?
Edited by NicholasIT, 25 June 2010 - 09:46 PM.
addtion info


Sign In
Create Account


Back to top









