criyle/codenet-compile-errors huggingface dataset:
Language: C

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

int isprime(int x){
	int i;
	if(x == 2){
		return true;
	}
	if(x < 2 || x%2 == 0){
		return false;
	}
	i = 3;
	while(i <= sqrt(x)){
		if(x%i == 0){
			return false;
		}
		i =+ 2;
	}
	return true;
}

int main(void){
	int a, b=0, n, i;
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%d", &a);
		if(isprime(a) == true){
			b++;
		}
	}
	printf("%d\n", b);
	return 0;
}

Compiler output:
main.c: In function 'isprime':
main.c:7:24: error: 'true' undeclared (first use in this function)
    7 |                 return true;
      |                        ^~~~
main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include<math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:7:24: note: each undeclared identifier is reported only once for each function it appears in
    7 |                 return true;
      |                        ^~~~
main.c:10:24: error: 'false' undeclared (first use in this function)
   10 |                 return false;
      |                        ^~~~~
main.c:10:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:27:34: error: 'true' undeclared (first use in this function)
   27 |                 if(isprime(a) == true){
      |                                  ^~~~
main.c:27:34: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

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

bool isprime(int x){
	int i;
	if(x == 2){
		return true;
	}
	if(x < 2 || x%2 == 0){
		return false;
	}
	i = 3;
	while(i <= sqrt(x)){
		if(x%i == 0){
			return false;
		}
		i =+ 2;
	}
	return true;
}

int main(void){
	int a, b=0, n, i;
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%d", &a);
		if(isprime(a) == true){
			b++;
		}
	}
	printf("%d\n", b);
	return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'bool'
    4 | bool isprime(int x){
      | ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include<math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c: In function 'isprime':
main.c:7:24: error: 'true' undeclared (first use in this function)
    7 |                 return true;
      |                        ^~~~
main.c:7:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:7:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:24: error: 'false' undeclared (first use in this function)
   10 |                 return false;
      |                        ^~~~~
main.c:10:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:27:34: error: 'true' undeclared (first use in this function)
   27 |                 if(isprime(a) == true){
      |                                  ^~~~
main.c:27:34: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include <stdio.h>

int isPrime(int s)
{
  int i, n=s;
  while(n != i){
    while(n % i)
      i++;
    else
      n /= i;
  }
  if(s == i) return 1;
  else       return 0;
}

int main()
{
  int n, a=0;
  while(scanf("%d", &n) != 0){
    if(isPrime(n)) a++;
  }
  printf("%d\n", a);
  return 0;
}

Compiler output:
main.c: In function 'isPrime':
main.c:9:5: error: 'else' without a previous 'if'
    9 |     else
      |     ^~~~
Language: C

#include <stdio.h>
#include <math.h>
??
int isPrime(int);
??
int main(){
????int a[10000],i,n,c=0;
????scanf("%d",&n);
????for(i=0;i<n;i++){
????????scanf("%d",&a[i]);
????????if(isPrime(a[i])==1)c++;
????}
??printf("%d\n",c);
??return 0;
}
??????????
int isPrime(int x){
????int i;
????if(x==2)return 1;
????if(x<2||x%2==0)return 0;
????i=3;
????while(i<=sqrt(x)){
????????if(x%i==0)return 0;
????????i=i+2;
????}
????return 1;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
main.c:5:1: error: expected identifier or '(' before '?' token
    5 | ??
      | ^
main.c:16:1: error: expected identifier or '(' before '?' token
   16 | ??????????
      | ^
Language: C


int main(){

int n_input;
int n;
int i;
int dev;
int sub_count;
int main_count;


scanf("%d",&input_n);

 for(i = 0;i <= input_n;i++){
  scanf("%d",&n);
  
  sub_count = 0;

  for(dev = 2; dev<=n ;dev++){
   if(n % dev == 0)sub_count++;
  } 
  if(sub_count == 2)main_count++;
 }
ptintf("%d",main_count);
}

Compiler output:
main.c: In function 'main':
main.c:12:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   12 | scanf("%d",&input_n);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:12:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   12 | scanf("%d",&input_n);
      | ^~~~~
main.c:12:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:13: error: 'input_n' undeclared (first use in this function)
   12 | scanf("%d",&input_n);
      |             ^~~~~~~
main.c:12:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:1: error: implicit declaration of function 'ptintf' [-Wimplicit-function-declaration]
   24 | ptintf("%d",main_count);
      | ^~~~~~
Language: C

#include <stdio.h>
//#include <math.h>
//int Prime(int);
int main(){
  int n, i, input, count=0, frag;
  scanf("%d",&n);
  for(; n>0; n--){
    scanf("%d",&input);
  if(x == 2) count++;
  else if(x<2 || x%2==0){
frag = 0;
break;
}
  for(i=3; i<input; i=i+2){
    if(x%i==0){
frag = 0;
break;
}
  }
  return 1;
    if(frag == 1)
      count++;
  }
  printf("%d\n",count);
  return 0;
}

/*int Prime(x){
  int i;
  if(x == 2) return 1;
  else if(x<2 || x%2==0) return 0;
  for(i=3; i<sqrt(x); i=i+2){
    if(x%i==0) return 0;
  }
  return 1;
}
*/

Compiler output:
main.c: In function 'main':
main.c:9:6: error: 'x' undeclared (first use in this function)
    9 |   if(x == 2) count++;
      |      ^
main.c:9:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int sqrt(int a) {
	int i;
	float res = 1;
	for (i = 0; i < 3; i++) {
		res = (res + a / res) / 2;
	}

	return res;
}

int main() {

	int num;
	int p_count = 0;
	int n, i;

	scanf("%d", &num);
	
	for (i = 0; i < num; i++) {
		scanf("%d", &n);

		if (isPrime(n)) {
			p_count++;
		}

	}


	printf("%d\n", p_count);

	return 0;
}

bool isPrime(int a) {

	int j;

	if (a == 2) {
		return true;
	}

	if (a < 2 && a % 2 == 0) {
		return false;
	}
	


	for (j = 2; j <= sqrt(n); j++) {
		if (n % j == 0) {
			return false;
		}
	}
	
	return true;
	
}

Compiler output:
main.c:3:5: warning: conflicting types for built-in function 'sqrt'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
    3 | int sqrt(int a) {
      |     ^~~~
main.c:2:1: note: 'sqrt' is declared in header '<math.h>'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c: In function 'main':
main.c:24:21: error: implicit declaration of function 'isPrime' [-Wimplicit-function-declaration]
   24 |                 if (isPrime(n)) {
      |                     ^~~~~~~
main.c: At top level:
main.c:36:1: error: unknown type name 'bool'
   36 | bool isPrime(int a) {
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'isPrime':
main.c:41:24: error: 'true' undeclared (first use in this function)
   41 |                 return true;
      |                        ^~~~
main.c:41:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:41:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:45:24: error: 'false' undeclared (first use in this function)
   45 |                 return false;
      |                        ^~~~~
main.c:45:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:50:31: error: 'n' undeclared (first use in this function)
   50 |         for (j = 2; j <= sqrt(n); j++) {
      |                               ^
Language: C

#include <stdio.h>

int sqrt(int a) {
	int i;
	float res = 1;
	for (i = 0; i < 3; i++) {
		res = (res + a / res) / 2;
	}

	return res;
}

int main() {

	int num;
	int p_count = 0;
	int n, i;

	scanf("%d", &num);
	
	for (i = 0; i < num; i++) {
		scanf("%d", &n);

		if (isPrime(n)) {
			p_count++;
		}

	}


	printf("%d\n", p_count);

	return 0;
}

bool isPrime(int a) {

	int j;

	if (a == 2) {
		return true;
	}

	if (a < 2 && a % 2 == 0) {
		return false;
	}
	


	for (j = 2; j <= sqrt(a); j++) {
		if (a % j == 0) {
			return false;
		}
	}
	
	return true;
	
}

Compiler output:
main.c:3:5: warning: conflicting types for built-in function 'sqrt'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
    3 | int sqrt(int a) {
      |     ^~~~
main.c:2:1: note: 'sqrt' is declared in header '<math.h>'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c: In function 'main':
main.c:24:21: error: implicit declaration of function 'isPrime' [-Wimplicit-function-declaration]
   24 |                 if (isPrime(n)) {
      |                     ^~~~~~~
main.c: At top level:
main.c:36:1: error: unknown type name 'bool'
   36 | bool isPrime(int a) {
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'isPrime':
main.c:41:24: error: 'true' undeclared (first use in this function)
   41 |                 return true;
      |                        ^~~~
main.c:41:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:41:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:45:24: error: 'false' undeclared (first use in this function)
   45 |                 return false;
      |                        ^~~~~
main.c:45:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include <stdio.h>

int sqrt(int a) {
	int i;
	float res = 1;
	for (i = 0; i < 3; i++) {
		res = (res + a / res) / 2;
	}

	return res;
}

bool isPrime(int a) {

	int j;

	if (a == 2) {
		return true;
	}

	if (a < 2 && a % 2 == 0) {
		return false;
	}



	for (j = 2; j <= sqrt(a); j++) {
		if (a % j == 0) {
			return false;
		}
	}

	return true;
}

int main() {

	int num;
	int p_count = 0;
	int n, i;

	scanf("%d", &num);
	
	for (i = 0; i < num; i++) {
		scanf("%d", &n);

		if (isPrime(n)) {
			p_count++;
		}

	}


	printf("%d\n", p_count);

	return 0;
}

Compiler output:
main.c:3:5: warning: conflicting types for built-in function 'sqrt'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
    3 | int sqrt(int a) {
      |     ^~~~
main.c:2:1: note: 'sqrt' is declared in header '<math.h>'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c:13:1: error: unknown type name 'bool'
   13 | bool isPrime(int a) {
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'isPrime':
main.c:18:24: error: 'true' undeclared (first use in this function)
   18 |                 return true;
      |                        ^~~~
main.c:18:24: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:18:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:24: error: 'false' undeclared (first use in this function)
   22 |                 return false;
      |                        ^~~~~
main.c:22:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include <stdio.h>
#define N  10000
int main(){
  int n,data[N],i,j,c=0,flag;
  scanf("%d",&n);
  if(n==0 || n > 10000) break;
  for(i=0; i<n; i++){
    scanf("%d",&data[i]);
  }
  for(i=0; i<n; i++){
    flag=0;
    for( j=2;j<data[i];j++ ) {
      if( data[i]%j==0 ) {
        flag = 1;
        break;
      }
    }
  if( flag==0 ) c++;
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:25: error: break statement not within loop or switch
    6 |   if(n==0 || n > 10000) break;
      |                         ^~~~~
Language: C

#include <stdio.h>

int sosuu(int);
int main(){
  int n,i,num,j;

  scanf("%d",&n);
  int a;
  for(i = 0;i<n;i++)
    {
      scanf("%d",&a);
      int f=0;
       for(j=2;j<x;j++)
    {
      if(x%j==0)
	{
	  f=1;
	  break;
	}
    }
      if(f==0)
	{
	  num++;
	}
    }
  printf("%d\n",num);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:18: error: 'x' undeclared (first use in this function)
   13 |        for(j=2;j<x;j++)
      |                  ^
main.c:13:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define N  10000
int main(){
  int n,data[N],i,j,c=0,flag;
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&data[i]);
  }
  for(i=0; i<n; i++){
    flag=0;
    for( j=2;j<data[i];j++ ) {
      if( data[i]%j==0 ) {
        flag = 1;
        break;
      }
    }
  if( flag==0 ) c++;
  }
  printf("%d\n",c);
  return 0;
};
    for( j=2;j<data[i];j++ ) {
      if( data[i]%j==0 ) {
        flag = 1;
        break;
      }
    }
  if( flag==0 ) c++;
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c:22:5: error: expected identifier or '(' before 'for'
   22 |     for( j=2;j<data[i];j++ ) {
      |     ^~~
main.c:22:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   22 |     for( j=2;j<data[i];j++ ) {
      |               ^
main.c:22:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   22 |     for( j=2;j<data[i];j++ ) {
      |                         ^~
main.c:28:3: error: expected identifier or '(' before 'if'
   28 |   if( flag==0 ) c++;
      |   ^~
main.c:29:3: error: expected identifier or '(' before '}' token
   29 |   }
      |   ^
main.c:30:10: error: expected declaration specifiers or '...' before string constant
   30 |   printf("%d\n",c);
      |          ^~~~~~
main.c:30:17: error: unknown type name 'c'
   30 |   printf("%d\n",c);
      |                 ^
main.c:31:3: error: expected identifier or '(' before 'return'
   31 |   return 0;
      |   ^~~~~~
main.c:32:1: error: expected identifier or '(' before '}' token
   32 | }
      | ^
Language: C

#include<stdio.h>

int main(){

  int i,j,sum,flag,sei[10000],count=0;

  scanf("%d",&sum);

  for(j=0;j<sum;j++)
    {
      scanf("%d",&sei[j]);
    }

  for(i=0;i<sum;i++)
    {
      flag=1
      for(j=2;j<sei[i]-1;j++)
	{
	  if(sei[i]%j == 0)
	    {
	      flag=0;
	      break;
	    }
	}
      count+=flag;
    }
 
     printf("%d\n",count);
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:13: error: expected ';' before 'for'
   16 |       flag=1
      |             ^
      |             ;
   17 |       for(j=2;j<sei[i]-1;j++)
      |       ~~~
Language: C

#include <stdio.h>
int main(){
  int n,i,j,c=0,flag;
  scanf("%d",&n);
  int data[n]
  for(i=0; i<n; i++){
    scanf("%d",&data[i]);
  }
  for(i=0; i<n; i++){
    flag=0;
    for( j=2;j<data[i];j++ ) {
      if( data[i]%j==0 ) {
        flag = 1;
        break;
      }
    }
  if( flag==0 ) c++;
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    6 |   for(i=0; i<n; i++){
      |   ^~~
main.c:7:17: error: 'data' undeclared (first use in this function)
    7 |     scanf("%d",&data[i]);
      |                 ^~~~
main.c:7:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

int main(){
  int A[10000];
  int prime=0,fl=0,i,j,num;

  for(i=0;i<10000;i++){
    if(scanf("%d",&A[i])==EOF) break;
    num++;
  }

  for(j=0;j<num;j++){
  for(i=2;i<1+sqrt(A[j]);i++){
    if(A[j]==2){
      fl=0;
      break;
    }
    if(A[j]%i==0){
      fl = 1;
      break;
    }
  }

  if(fl==0) prime++;
  fl = 0;
  }

printf("%d\n",prime);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |     if(scanf("%d",&A[i])==EOF) break;
      |        ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:6:8: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |     if(scanf("%d",&A[i])==EOF) break;
      |        ^~~~~
main.c:6:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:27: error: 'EOF' undeclared (first use in this function)
    6 |     if(scanf("%d",&A[i])==EOF) break;
      |                           ^~~
main.c:6:27: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:6:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:15: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   11 |   for(i=2;i<1+sqrt(A[j]);i++){
      |               ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | int main(){
main.c:11:15: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   11 |   for(i=2;i<1+sqrt(A[j]);i++){
      |               ^~~~
main.c:11:15: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:26:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 | printf("%d\n",prime);
      | ^~~~~~
main.c:26:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#define N 10000

int main(){

  int n,i,j,count=0,net;
  int Prime[N=1];
  
  scanf("%d",&n);

  for(i=0;i<n;i++)
    scanf("%d",&Prime[i]);

  for(i=0;i<n;i++){
 
    for(j=2;j < Prime[i];j++){

      if(Prime[i]%j==0)
	net=777;
	break;

    }
    if(Prime[i]==2)
      count++;
    else if(net==0)
      count++;

    net=0;
      
  }

  printf("%d\n",count);
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:7:14: error: lvalue required as left operand of assignment
    7 |   int Prime[N=1];
      |              ^
Language: C

#include<stdio.h>
static const int N = 10000;

int main(){

  int n,i,j,count=0,net;
  int Prime[N=1];
  
  scanf("%d",&n);

  for(i=0;i<n;i++)
    scanf("%d",&Prime[i]);

  for(i=0;i<n;i++){
 
    for(j=2;j < Prime[i];j++){

      if(Prime[i]%j==0)
	net=777;
	break;

    }
    if(Prime[i]==2)
      count++;
    else if(net==0)
      count++;

    net=0;
      
  }

  printf("%d\n",count);
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:7:14: error: assignment of read-only variable 'N'
    7 |   int Prime[N=1];
      |              ^
Language: C

#include <stdio.h>
int main(){
  int n,i,j,c=0,flag;
  scanf("%d",&n);
  int data[n]
  for(i=0; i<n; i++){
    scanf("%d",&data[i]);
  }
  for(i=0; i<n; i++){
    for( j=2;j<data[i];j++ ) {
      if( data[i]%j==0 ) {
        flag = 1;
        break;
      }
    }
  if( flag==0 ) c++;
  else flag=0;
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    6 |   for(i=0; i<n; i++){
      |   ^~~
main.c:7:17: error: 'data' undeclared (first use in this function)
    7 |     scanf("%d",&data[i]);
      |                 ^~~~
main.c:7:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
int isprime(int x);
 {
    int c;
    if(x == 2)return 1;
    if(x<2 || x%2==0)return 2;
    c = 3;
    if(c <= sqrt((double)x)){
      return 2;
      c = c+2;
    }
    return 1;
  }

int main(){
  int i,n,number[n],count=0,res;
  scanf("%d",&n);
  scanf("%d",number[n]);

  
  for(i=0;i<n;i++){
   res = isprime(number[i]);
   if(res == 1)count++;
  }
   printf("%d",count);
  
   return 0;
  }

Compiler output:
main.c:4:2: error: expected identifier or '(' before '{' token
    4 |  {
      |  ^
Language: C

#include<stdio.h>
#include<math.h>
#define N 10000

int prime(int);

int main()
{
  int A[N], i, p, number, count=0;
  scanf("%d", &number);
  for( i=0 ; i<number ; i++ ){
    scanf("%d", &A[i]);
    p = prime(A[i]);
    if( p==1 ) count++;
  }
  
  printf("%d\n", count);
  return 0;
}
int prime(int a)
{
  int i;
  if( a==2 ) return 1;
  if( a<2 || a%2==0 ) return 0;
  i = 3;
  while( j<=sqrt(a) ){
    if( a%j==0 ) return 0;
    i = i+2;
  }
  return 1;
}

Compiler output:
main.c: In function 'prime':
main.c:26:10: error: 'j' undeclared (first use in this function)
   26 |   while( j<=sqrt(a) ){
      |          ^
main.c:26:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
int isprime(double x)
 {
    int c;
    if(x == 2)return 1;
    if(x<2 || x%2==0)return 0;
    c = 3;
    if(c <= sqrt(x)){
      return 0;
      c = c+2;
    }
    if(x%c == 0)return 0;
    return 1;
  }

int main(){
  int i,n,count=0,res;
  scanf("%d",&n);
  int number[n];

  
  for(i=0;i<n;i++){
      scanf("%d",number[n]);
   res = isprime(number[i]);
   if(res == 1)count++;
  }
   printf("%d",count);
  
   return 0;
  }

Compiler output:
main.c: In function 'isprime':
main.c:7:16: error: invalid operands to binary % (have 'double' and 'int')
    7 |     if(x<2 || x%2==0)return 0;
      |                ^
main.c:13:9: error: invalid operands to binary % (have 'double' and 'int')
   13 |     if(x%c == 0)return 0;
      |         ^
Language: C

#include<stdio.h>
#include<math.h>
#define N 10000

int prime(int);

int main()
{
  int A[N], i, p, number, count=0;
  scanf("%d", &number);
  for( i=0 ; i<number ; i++ ){
    scanf("%d", &A[i]);
    p = prime(A[i]);
    if( p==1 ) count++;
  }
  
  printf("%d\n", count);
  return 0;
}
int prime(int a)
{
  int i;
  if( a==2 ) return 1;
  if( a<2 || a%2==0 ) return 0;
  i = 3;
  while( i<=sqrt(a) ){
    if( a%j==0 ) return 0;
    i = i+2;
  }
  return 1;
}

Compiler output:
main.c: In function 'prime':
main.c:27:11: error: 'j' undeclared (first use in this function)
   27 |     if( a%j==0 ) return 0;
      |           ^
main.c:27:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
#define N 10000
int isprime(double x);

int main(){
  int num[N],i=0,j,count=0,n;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    if (scanf("%d",&num[i])==EOF) break;
    count+=isprime((double)num[i]);
    
  }  
    printf("%d\n",count);
    return 0;
  
}

int isprime(double x) {
  int i;
  
  if (x==2)
    return 1;
  if(x< 2|| ((dounle)x%2)==0)
    return 0;
  
  i=3;
  while((double)i<=sqrt(x)){
    if ((double)x%i==0) return 0;
    i = i+2;
  }
  return 1;
}

Compiler output:
main.c: In function 'isprime':
main.c:26:15: error: 'dounle' undeclared (first use in this function); did you mean 'double'?
   26 |   if(x< 2|| ((dounle)x%2)==0)
      |               ^~~~~~
      |               double
main.c:26:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:22: error: expected ')' before 'x'
   26 |   if(x< 2|| ((dounle)x%2)==0)
      |             ~        ^
      |                      )
main.c:31:18: error: invalid operands to binary % (have 'double' and 'int')
   31 |     if ((double)x%i==0) return 0;
      |         ~~~~~~~~~^
      |         |
      |         double
Language: C

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

int isPrime(int);

int main()
{
  int n, *data, k = 0, i, key;

  /*??\??????????????°????±????*/
  scanf("%d", &n);

  data = (int *)malloc(n * sizeof(int));

  for(i = 0; i < n; i++)
    scanf("%d", &data[i]);

  for(i = 0; i < n; i++){
    key = isPrime(data[i]);
    if(key == 1)
      k++;
  }
  printf("%d\n", k);
  free(data);
  return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccDvrHf5.o: in function `main':
main.c:(.text+0xa1): undefined reference to `isPrime'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 10000
int isPrime(int);

int main() {
  int i,n,num[N],cnt=0;
  scanf("%d",&n);
  for (i = 0; i < n; i++) {
  scanf("%d",&num[i]);
  }
  for (i = 0; i < n; i++) {
    if (isPrime(num[i]) == 1) cnt++;
  }
  printf("%d\n",cnt);
  return 0;
}

int isPrime(int n){
  int i;
  if (n == 2) retune 1;
  for (i = 2; i < n/2; i++) {
    if (n%i == 0) return 0;
  }
  return 1;
}

Compiler output:
main.c: In function 'isPrime':
main.c:20:15: error: 'retune' undeclared (first use in this function)
   20 |   if (n == 2) retune 1;
      |               ^~~~~~
main.c:20:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:21: error: expected ';' before numeric constant
   20 |   if (n == 2) retune 1;
      |                     ^~
      |                     ;
Language: C

include <stdio.h>

static const int N = 10000;

int main(){
  int i, j, k = 2, num[N], count = 0;

  scanf("%d",&i);
  for(j = 0; j < i; j++){
    scanf("%d",&num[j]);
    for(k = 2; k < num[j]; k++){
      if(num[j] < 2) break;
      if(num[j] % k == 0) break;
    }
    if(k == num[j]) count++;
  }
  printf("%d\n",count);
  
  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:6:24: error: 'N' undeclared (first use in this function)
    6 |   int i, j, k = 2, num[N], count = 0;
      |                        ^
main.c:6:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |   scanf("%d",&i);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:8:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |   scanf("%d",&i);
      |   ^~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:17:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |   printf("%d\n",count);
      |   ^~~~~~
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#define N 10000
int main() {
  int num = 0;
  int i, j, length, flag, data[N];
  scan("%d",&length);
  for(i = 0; i < length; i++){
    scan("%d", &data[i]);
  }
  for(i = 0; i < length; i++){
    flag = 0;
    for(j = 2; j < data[i]; ++j){
      if(data[i] % j == 0) {
        flag = 1;
        break;
      }
    }
    if(flag == 0) num++;
  }
  printf("\n%d\n", num);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |   scan("%d",&length);
      |   ^~~~
      |   scanf
Language: C

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

int isPrime(int);

int main(){
  int i = 0, n, total = 0;
  int num[10000];

  scanf("%d", &n);
  while((scanf("%d", &num[i])) != EOF) {
    i++;
  }

  for(i = 0; i < n; i++) {
    if(isPrime(num[i])) total++;
  }
  printf("%d\n", total);

  return 0;
}

int isPrime(int num) {
  int i;

  if (num == 2) return 1;
  if (x < 2 || x%2 != 0) return 0;

  i = 3;
  while (i <= sqrt(x)) {
    if(x%i==0) return 0;
    i += 2;
  }
  return 1;
}

Compiler output:
main.c: In function 'isPrime':
main.c:27:7: error: 'x' undeclared (first use in this function)
   27 |   if (x < 2 || x%2 != 0) return 0;
      |       ^
main.c:27:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define N 10000

int isPrime(int n);

int main()
{

  int number[N],a,n=0,flag;

  scanf("%d",&a);

  for(i = 0;i < a;i++)
  {
    scanf("%d",&number[i]);
    flag = isPrime(number[i]);
    if(flag == 1)n++;
  }

  printf("%d\n",n);


  return 0;

}
      
int isPrime(int n)
{
  int i;

  if(n <= 1)return 0;

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

  return 1;
}

Compiler output:
main.c: In function 'main':
main.c:13:7: error: 'i' undeclared (first use in this function)
   13 |   for(i = 0;i < a;i++)
      |       ^
main.c:13:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int isprime(int);

int main(void){

	int n,num,i,flag=0;

	scanf("%d\n",&n);

	for(i = 0; i < n; i++){
		scanf("%d",&num);
		if(isprime(num) == 1){
			flag++;
		}
	}

	printf("%d\n",flag);
	return 0;
}

int isprime(int x){

	int i;

	if(x == 2 || x == 3) return 1;
	else if(x <= 1) return 0

	for(i = 2; i <= x/2; i++){		
		if(x % i == 0) return 0;
	}
	return 1;
}

Compiler output:
main.c: In function 'isprime':
main.c:27:33: error: expected ';' before 'for'
   27 |         else if(x <= 1) return 0
      |                                 ^
      |                                 ;
   28 | 
   29 |         for(i = 2; i <= x/2; i++){
      |         ~~~
Language: C

#include <stdio.h>

int main()
{
 int n,count=0,a[10000],i,j;
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {
  scanf("%d",&a[i]);
 }
 for(i=0;i<n;i++)
 {
  for(j=1;j<=i;j++)
  {
   if(a[i]%j==0)
    temp++;
   if(temp2>1 && temp<3)
    count++;
  }
 }
 printf("%d",count);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:5: error: 'temp' undeclared (first use in this function)
   16 |     temp++;
      |     ^~~~
main.c:16:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:7: error: 'temp2' undeclared (first use in this function); did you mean 'tempnam'?
   17 |    if(temp2>1 && temp<3)
      |       ^~~~~
      |       tempnam
Language: C

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

bool isprime(int x)
{
	int i = 3;
	if(x == 2) return true;
	
	if(x < 2 || x % 2 == 0) return false;
	
	while(i <= sqrt(x))
	{
		if(x % i == 0) return false;
		i += 2;
	}
}

int main()
{
	int i,n,count = 0;
	int a[10000];
	
	scanf("%d",&n);
	for(i = 0; i < n; i++) scanf("%d\n",a + i);
	
	for(i = 0; i < n; i++) count += isprime(a[n]);
	
	printf("%d\n",count);
	
	return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'bool'
    4 | bool isprime(int x)
      | ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c: In function 'isprime':
main.c:7:27: error: 'true' undeclared (first use in this function)
    7 |         if(x == 2) return true;
      |                           ^~~~
main.c:7:27: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:7:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:40: error: 'false' undeclared (first use in this function)
    9 |         if(x < 2 || x % 2 == 0) return false;
      |                                        ^~~~~
main.c:9:40: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>
#include<math.h>
#define T 1
#define F 0
#define N 10000
int isprime(int a){
  int i;
  if (a==2)
    return T;
  if (a<2 || a%2==0)
    return F;
  i = 3;
  while (i<= sqrt(a)){
    if (a%i==0)
      return F;
    i = i + 2;
  }
  return T;
}
int main(){
  int a,n,i,count=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&a);
    count = count + isprime(a);
  }
  printf("%d\n",count);
  return 0;
} 
int isprime(int a){
  int i;
  if (a==2)
    return T;
 
  if (a<2 || a%2==0)
    return F;
 
  i = 3;
  while(i<= sqrt(a)){
    if (a%i==0)
      return F;
    i = i + 2;
  }
  return T;

Compiler output:
main.c:30:5: error: redefinition of 'isprime'
   30 | int isprime(int a){
      |     ^~~~~~~
main.c:6:5: note: previous definition of 'isprime' with type 'int(int)'
    6 | int isprime(int a){
      |     ^~~~~~~
main.c: In function 'isprime':
main.c:44:3: error: expected declaration or statement at end of input
   44 |   return T;
      |   ^~~~~~
Language: C

#include <stdio.h>
#include <math.h>
 
int isprime(int){
 
  int i;
  if(x==2) return 1;
  if(x<2 || x%2==0) return 0;
  i=3;
  while(i<=sqrt(x)){
    if(x%i==0) return 0;
    i = i+2;
  }
  return 1;
}
int main()
{
  int n, i, j, count=0, p[10000];
 
  scanf("%d",&n);
  for( i=0 ; i<n ; i++ ){
    scanf("%d",&p[i]);
    count += isprime(p[i]);
  }
 
  printf("%d\n",count);
  return 0;
}

{

Compiler output:
main.c: In function 'isprime':
main.c:7:6: error: 'x' undeclared (first use in this function)
    7 |   if(x==2) return 1;
      |      ^
main.c:7:6: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:30:1: error: expected identifier or '(' before '{' token
   30 | {
      | ^
Language: C

#include <stdio.h>
#include <math.h>
 
int isprime(int){
 
  int i;
  if(x==2) return 1;
  if(x<2 || x%2==0) return 0;
  i=3;
  while(i<=sqrt(x)){
    if(x%i==0) return 0;
    i = i+2;
  }
  return 1;
}
int main()
{
  int n, i, j, count=0, p[10000];
 
  scanf("%d",&n);
  for( i=0 ; i<n ; i++ ){
    scanf("%d",&p[i]);
    count += isprime(p[i]);
  }
 
  printf("%d\n",count);
  return 0;
}

Compiler output:
main.c: In function 'isprime':
main.c:7:6: error: 'x' undeclared (first use in this function)
    7 |   if(x==2) return 1;
      |      ^
main.c:7:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <math.h>
??
int isprime(int){


????int i;
????if(x==2) return 1;
????if(x<2 || x%2==0) return 0;
????i=3;
????while(i<=sqrt(x)){
????????if(x%i==0) return 0;
????????i = i+2;
????}
????return 1;
}

??
int main()
{
????int n, i, j, count=0, p[10000];
??
????scanf("%d",&n);
????for( i=0 ; i<n ; i++ ){
????????scanf("%d",&p[i]);
????????count += isprime(p[i]);
????}
??
????printf("%d\n",count);
????return 0;
}
??

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
main.c:18:1: error: expected identifier or '(' before '?' token
   18 | ??
      | ^
main.c:32:1: error: expected identifier or '(' before '?' token
   32 | ??
      | ^
Language: C

#include <stdio.h>
#include <math.h>
??
int check(int x)
{
????int y=3;
??
????while(y<=sqrt(x)){
????????if(x%y==0) return 0;
??
????????y+=2;
????}
????return 1;
}
??
int main(){
int num[10000], i, number, x;
int M=0;
??
scanf("%d", &number);
for(i=0; i<number; i++){
????scanf("%d", &num[i]);
}
??
for(i=0; i<number; i++){
??
????if(num[i]==2){
????????M++;
????????continue;
????}
????else if(num[i]<2||num[i]%2==0){
????????continue;
????}
????x=check(num[i]);
????if(x==1) M++;
}
printf("%d\n", M);
return 0;
}
??

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
main.c:15:1: error: expected identifier or '(' before '?' token
   15 | ??
      | ^
main.c:40:1: error: expected identifier or '(' before '?' token
   40 | ??
      | ^
Language: C

#include<stdio.h>

int main(){
	int i, j;
	int n, temp;
	int count;
	    for(i = 0; i < n; i++){
        scanf("%d", &tmp);
        for(j = 2; j <= sqrt(tmp); j++){
            if (tmp???%???j == 0) break;
        }
        if (j>sqrt(tmp) || sqrt(tmp)<2){
count++;
}
}
    printf("%d\n", count);
return 0; 
}

}

Compiler output:
main.c: In function 'main':
main.c:8:22: error: 'tmp' undeclared (first use in this function); did you mean 'temp'?
    8 |         scanf("%d", &tmp);
      |                      ^~~
      |                      temp
main.c:8:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:25: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    9 |         for(j = 2; j <= sqrt(tmp); j++){
      |                         ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c:9:25: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    9 |         for(j = 2; j <= sqrt(tmp); j++){
      |                         ^~~~
main.c:9:25: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:10:21: error: expected expression before '?' token
   10 |             if (tmp???%???j == 0) break;
      |                     ^
main.c:12:15: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   12 |         if (j>sqrt(tmp) || sqrt(tmp)<2){
      |               ^~~~
main.c:12:15: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c: At top level:
main.c:20:1: error: expected identifier or '(' before '}' token
   20 | }
      | ^
Language: C

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

int main(){
	int i, j;
	int n, temp;
	int count;
	    for(i = 0; i < n; i++){
        scanf("%d", &tmp);
        for(j = 2; j <= sqrt(tmp); j++){
            if (tmp???%???j == 0) break;
        }
        if (j>sqrt(tmp) || sqrt(tmp)<2){
count++;
}
}
    printf("%d\n", count);
return 0; 
}

}

Compiler output:
main.c: In function 'main':
main.c:9:22: error: 'tmp' undeclared (first use in this function); did you mean 'temp'?
    9 |         scanf("%d", &tmp);
      |                      ^~~
      |                      temp
main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:21: error: expected expression before '?' token
   11 |             if (tmp???%???j == 0) break;
      |                     ^
main.c: At top level:
main.c:21:1: error: expected identifier or '(' before '}' token
   21 | }
      | ^
Language: C

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

int main(){
	int i, j;
	int n, temp;
	int count = 0;
	    for(i = 0; i < n; i++){
        scanf("%d", &tmp);
        for(j = 2; j <= sqrt(tmp); j++){
            if (tmp???%???j == 0) break;
        }
        if (j>sqrt(tmp) || sqrt(tmp)<2){
count++;
}
}
    printf("%d\n", count);
return 0; 
}

}

Compiler output:
main.c: In function 'main':
main.c:9:22: error: 'tmp' undeclared (first use in this function); did you mean 'temp'?
    9 |         scanf("%d", &tmp);
      |                      ^~~
      |                      temp
main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:21: error: expected expression before '?' token
   11 |             if (tmp???%???j == 0) break;
      |                     ^
main.c: At top level:
main.c:21:1: error: expected identifier or '(' before '}' token
   21 | }
      | ^
Language: C

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

int main(){
	int i, j;
	int n, temp;
	int count = 0;
	    for(i = 0; i < n; i++){
        scanf("%d", &tmp);
        for(j = 2; j <= sqrt(tmp); j++){
            if (tmp???%???j == 0) break;
        }
        if (j > sqrt(tmp) || sqrt(tmp) < 2){
count++;
}
}
    printf("%d\n", count);
return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:9:22: error: 'tmp' undeclared (first use in this function); did you mean 'temp'?
    9 |         scanf("%d", &tmp);
      |                      ^~~
      |                      temp
main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:21: error: expected expression before '?' token
   11 |             if (tmp???%???j == 0) break;
      |                     ^
Language: C

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

int main(){
	int i,  j;
	int n, tmp;
	int count = 0;
	    for(i = 0; i < n; i++){
        scanf("%d", &tmp);
        for(j = 2; j <= sqrt(tmp); j++){
            if (tmp???%???j == 0) break;
        }
        if (j > sqrt(tmp) || sqrt(tmp) < 2){
count++;
}
}
    printf("%d\n", count);
return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:11:21: error: expected expression before '?' token
   11 |             if (tmp???%???j == 0) break;
      |                     ^
Language: C

#include <stdio.h>
#include <math.h>
 
int isprime(int x)
{
  int i;

  if(x==2){
  return 1;
  }
  if(x<2||x%2==0){
  return 0;
  }

  for(i=3;i<=sqrt(x);i+=2){
    if(x%i==0)
    {
      return 0;
    }
    return 1;
  }  
}
 
int main(void)
{

  int n,x,i
  int num=0;
 
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
    scanf("%d",&x);
    if(isprime(x))num++;
  }
   
  printf("%d\n",num);
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
   28 |   int num=0;
      |   ^~~
main.c:31:7: error: 'i' undeclared (first use in this function)
   31 |   for(i=0;i<n;i++)
      |       ^
main.c:31:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:19: error: 'num' undeclared (first use in this function)
   34 |     if(isprime(x))num++;
      |                   ^~~
Language: C

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

int main(void){
  int n, a, b, i, j, count=0, A[10000];
  scanf("%d", &n);
  for(i=0;i<n;i++){
      j = 2;
      b = sqrt(a);
      while(a % j > 0 && j <= b) j++;
      if(j == b){
        A[count] = a;
        count++;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}

Compiler output:
main.c:17:10: error: expected declaration specifiers or '...' before string constant
   17 |   printf("%d\n", count);
      |          ^~~~~~
main.c:17:18: error: unknown type name 'count'
   17 |   printf("%d\n", count);
      |                  ^~~~~
main.c:18:3: error: expected identifier or '(' before 'return'
   18 |   return 0;
      |   ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C

/*
 * Problem: Prime Numbers
 * Author: Khan
 * Date: 11th October, 2017
 */
#include <stdio.h>

int cnt = 0;

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

int main(int argc, char const *argv[])
{
    freopen("sample.txt", "r", stdin);
    int N, a;
    scanf("%d", &N);
    for (int i = 0; i < N; ++i)
    {
        scanf("%d", &a);
        if(isPrime(a))
            cnt++;
    }
    printf("%d\n", cnt);
    return 0;
}

Compiler output:
main.c: In function 'isPrime':
main.c:12:8: error: 'x' undeclared (first use in this function)
   12 |     if(x < 2)
      |        ^
main.c:12:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/*
 * Problem: Prime Numbers
 * Author: Khan
 * Date: 11th October, 2017
 */
#include <stdio.h>

int cnt = 0;

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

int main(int argc, char const *argv[])
{
    //freopen("sample.txt", "r", stdin);
    int N, a;
    scanf("%d", &N);
    for (int i = 0; i < N; ++i)
    {
        scanf("%d", &a);
        if(isPrime(a))
            cnt++;
    }
    printf("%d\n", cnt);
    return 0;
}

Compiler output:
main.c: In function 'isPrime':
main.c:12:8: error: 'x' undeclared (first use in this function)
   12 |     if(x < 2)
      |        ^
main.c:12:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){

  int n,i,j,c,a,;

   scanf("%d",&n);

  for(i=1;i<=n;i++){

   scanf("%d",&a);

    for(j=2;j<a;j++){

    if(a%j==0)

      c++;

     }

  }

    printf("%d\n",c);

     return 0;

}


 

Compiler output:
main.c: In function 'main':
main.c:5:17: error: expected identifier or '(' before ';' token
    5 |   int n,i,j,c,a,;
      |                 ^
Language: C

#include<stdio.h>

int main(){

  int n,i,j,a,count;

   scanf("%d",&n);

  for(i = 1; i <= n; i++){

     scanf("%d",&a);

    for(j = 2; j < a; j++){

  if(a % j ==0){

    break;

  }else{

    count++;

     break;

            }


        }

    }

    printf("%d\n",c);

     return 0;

 }

Compiler output:
main.c: In function 'main':
main.c:32:19: error: 'c' undeclared (first use in this function)
   32 |     printf("%d\n",c);
      |                   ^
main.c:32:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){

  int n,i,j,a,count = 0;

   scanf("%d",&n);

  for(i = 1; i <= n; i++){

     scanf("%d",&a);

    for(j = 2; j < a; j++){

  if(a % j ==0){

    break;

  }else{

    count++;

     break;

            }


        }

    }

    printf("%d\n",c);

     return 0;

 }

Compiler output:
main.c: In function 'main':
main.c:32:19: error: 'c' undeclared (first use in this function)
   32 |     printf("%d\n",c);
      |                   ^
main.c:32:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main () 
{
  int n = 0, i, ans = 0,temp = 1;
  int a[10000] = 0;
  scanf("%d",&n);

  for (i = 0; i < n; i++) {
    scanf("%d",&a[i]);
  }
  for (i = 0; i < n; i++) {
    temp = 0;
    for (j = 2; j < a[i]; j++) {
      if(a[i] % j == 0) {
        temp = 1;
      }
    if( temp == 1) { 
      break;
    }
    }
    if(temp == 0) { 
      ans = ans + 1;
    } 
  }
  printf("%d\n",ans);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:18: error: invalid initializer
    6 |   int a[10000] = 0;
      |                  ^
main.c:14:10: error: 'j' undeclared (first use in this function)
   14 |     for (j = 2; j < a[i]; j++) {
      |          ^
main.c:14:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main () 
{
  int n = 0, i, ans = 0,temp;
  int a[10000];
  scanf("%d",&n);
  for (i = 0; i < n; i++) {
    scanf("%d",&a[i]);
  }
  for (i = 0; i < n; i++) {
    temp = 0;
    for (j = 2; j < a[i]; j++) {
      if(a[i] % j == 0) {
        temp = 1;
      }
    if( temp == 1) { 
      break;
    }
    }
    if(temp == 0) { 
      ans = ans + 1;
    } 
  }
  printf("%d\n",ans);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:10: error: 'j' undeclared (first use in this function)
   13 |     for (j = 2; j < a[i]; j++) {
      |          ^
main.c:13:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void)
{

  int i, j, a;

  for(i=1;i<=10000;i++)
  {

   a=0;

    for(j=1;j<=i;j++)
    {

       if(i%j==0){

        a++;
     
     }
    }

     if(a==2){

      printf("%d\n", i);

    }

    printf("\n");

    return 0;

 }

Compiler output:
main.c: In function 'main':
main.c:33:2: error: expected declaration or statement at end of input
   33 |  }
      |  ^