So after a day or two of trying i finally found out how to do this, my question is, is there any way to do this that is more efficient without using the prime function?
#include <iostream>
using namespace std;
int main()
{
std::string line;
int i, p, x;
for(i = 3; i <=100; i++) {
for(p=2; p<i; p++)
{
if((i%p) == 0) x = 0;
}
if(x != 0) cout << i << " is prime\n";
x = 1;
}
getline(cin,line);
cin.get();
return 0;
}