First thing to note is that your inside an infinite loop. I don't believe anyone should use goto's, labels, continue, break (except in switch statments) because it hurts readability for you and others.
#include <cstdlib>
#include <iostream>
#define MAX_PRIME_NUMBER 1000
usingnamespace std;
int x=1;
int y;
int main()
{
//goes through all the numbers
for( int i = 1; i < MAX_PRIME_NUMBER; i++)
{
//from here down to the end of the for loop you should
//figure out if the number is prime or not before the end of the for loop
//and print or save them
int Prime [1000] = {x};
int n=1;
signedint m=1;
if (n/Prime[y]!=1)
{
n=n+2;
x++;
x++;
}
elseif (n/Prime[y]==1)
{
cout << n << " ";
n=n+2;
x++;
x++;
}
elseif (n/Prime[y]>=1)
{
n=n+2;
x++;
x++;
}
else
{
n=n+2;
}
}
system("PAUSE");
}
ok ty, my problem comes up where i need to add a number to the array. I tried to use a while loop, but i get runtime error. Any suggestions how i could improve this?
Dexter