Prime Number Code

Can somebody help me with the code of Prime Number. I m a beginner in c++.
Help is appreciated.
For my page, visit http://www.philica.com/display_article.php?article_id=490

Thanks
Mike
Last edited on
1
2
3
4
5
6
7
8
9
10
11
 int i=0;
counter=0;
for(int i=2;i<(number/2);i++){
if(number%i==0)
counter++;
}
if(counter>0){
cout<<"isnt prime";
}
else
cout<<"prime";
Topic archived. No new replies allowed.