#include <stdio.h>

int main() {
    int n,num=2,flag;
    scanf("%d",&n);
    
    while (n){
        flag=1;
        for (int i=2;i<num; i++) {
            if (num%i==0) {
                flag=0;
                break;
            } 
        }
        if (flag==1) {
            printf("%d ",num);
            n--;
        }
        num++;
    }
    return 0;
}

Embed on website

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