#include <iostream>
using namespace std;
int main(){
bool check = true;
//All prime numbers till 100.
for (int num = 2; num<=100; num++){
for (int j=2; j<num; j++){
if (num%j == 0){
check = false;
}
}
if (check == true){
cout << num << endl;
}
check = true;
}
return 0;
}
No comments:
Post a Comment