954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

prime numbers

i wrote this program to find prime numbers, but whenever i run it, i get an error.
This is the code [c++]:

int main(void)
{

int num=0;
int i=0;

cout<<"num";
cin>>num;

while(i>num;
Goldbach(num,prime1,prime2);
cout<

quasimof
Newbie Poster
4 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

int main(void) {

int num=0; int i=0;

cout<<"num"; cin>>num;

while(i

Not a master of the language but the error might be that you are dividing by zero. Not sure how C++ handles that off the top of my head.

jasweb2002
Junior Poster in Training
56 posts since Sep 2004
Reputation Points: 11
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You