Need a project done?

C++ Programming Developer

Search This Blog

Showing posts with label all prime numbers till 100.. Show all posts
Showing posts with label all prime numbers till 100.. Show all posts

Prime numbers C++


#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;
}
"Don't let anyone ever make you feel like you don't deserve what you want."