#include <stdio.h>

int verifica_Primo(int n){
	for (int i = 2; i*i <= n; i++){
		if (n % i == 0){
			return 1;
		} 
	} 
	return 0;
}

int main(){
	
	int n;
	scanf("%d", &n);
	
	for(int i = 0; i < n; i++){
		if(verifica_Primo(i) == 0){
			printf("%d\n", i);
		}
	} printf("\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: