int main (char argv)
{
int tempNum = atoi(argv);
for (int i=3; i<=tempNum; i++)
for (int j=2; j*j<=i; j++)
{
if (i % j == 0)
break;
else if (j+1 > sqrt(i)) {
cout << i << " ";
}
}
return 0;
}
Printing prime numbers from 1 through 100
Basically this, but modified