#include <iostream>
using namespace std;

int check_prime(int num){

    int cnt = 0;
    for(int i = 1;i<= num ;i++ ){
        if (num % i == 0){

            cnt++;
        }
        
    }
    if(cnt==2){
        return 1;
    }
    else{
        return 0;
    }
}


int main() {
        for(int i=1000000; i<=10000000; i++){
            if (check_prime(i)==1){
                cout << i << "\n";
            }
        }

        return 0;
    
    }

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: