Tại sao code bị lỗi expected declaration or statement at end of input

Đề bài yêu cầu in ra các số nguyên tố trong khoảng [10000; 10000000] Mình mới học C code báo lỗi này là sao hả mọi người ? [Error] expected declaration or statement at end of input

#include<stdio.h>
#include<math.h>

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

int main(){
	printf("Cac so tu nhien tu 5 den 7 chu so thoa man:\n");
	printf("La so nguyen to:\n");
	for(int i = 10000; i < 10000000; i++){
		if(Prime(i) == 1){
			printf("%5d", i);
		}
	}
	return 0;
}

Hàm Prime thiếu 1 dấu ngoặc nhọn đóng hàm.

2 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?