e mới làm bài và tham khảo bài a chị trên e ko hiểu đoạn dem=0 ở cuối chương trình ai giải thích giúp với ạ
#include<stdio.h>
#include<conio.h>
int main() {
int n, dem;
scanf("%d", &n);
if(n<2) {
printf("%d ko la so nguyen to\n", n);
} else {
for(int i=2;i<=n;i++){
for(int j=1;j<=i;j++){
if(i%j==0)
dem++;
}
if(dem == 2)
printf("%d la so nguyen to\n", i);
else
printf("%d ko la so nguyen to\n", i);
dem=0;
}
}
return 0;
}