Language: C

#include<stdio.h>
#define int MAX_V = 10000;
int prime[MAX_V + 1];
int sum[MAX_V + 1];
int main(){
  int n, i, k;
  for(i = 2;i <= MAX_V;i++){
    prime[i] = 1;
  }
  for(i=2;i*i<=MAX_V;i++){
    if(prime[i]){
      for(k = 2*i;k <= MAX_V;k += i){
        prime[k] = 0;
      }
    }
  }
  sum[0] = 0;
  for(i = 0;i < MAX_V;i++){
    sum[i+1] = sum[i]+prime[i+1];
  }
  while(scanf("%d", &n) != EOF){
    printf("%d\n", sum[n]);
  }
  return 0;
}

Compiler output:
main.c:2:13: warning: data definition has no type or storage class
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:3:1: note: in expansion of macro 'int'
    3 | int prime[MAX_V + 1];
      | ^~~
main.c:2:13: error: type defaults to 'int' in declaration of 'MAX_V' [-Wimplicit-int]
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:3:1: note: in expansion of macro 'int'
    3 | int prime[MAX_V + 1];
      | ^~~
main.c:3:5: warning: data definition has no type or storage class
    3 | int prime[MAX_V + 1];
      |     ^~~~~
main.c:3:5: error: type defaults to 'int' in declaration of 'prime' [-Wimplicit-int]
main.c:3:5: error: variably modified 'prime' at file scope
main.c:2:13: warning: data definition has no type or storage class
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:4:1: note: in expansion of macro 'int'
    4 | int sum[MAX_V + 1];
      | ^~~
main.c:2:13: error: type defaults to 'int' in declaration of 'MAX_V' [-Wimplicit-int]
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:4:1: note: in expansion of macro 'int'
    4 | int sum[MAX_V + 1];
      | ^~~
main.c:2:13: error: redefinition of 'MAX_V'
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:4:1: note: in expansion of macro 'int'
    4 | int sum[MAX_V + 1];
      | ^~~
main.c:2:13: note: previous definition of 'MAX_V' with type 'int'
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:3:1: note: in expansion of macro 'int'
    3 | int prime[MAX_V + 1];
      | ^~~
main.c:4:5: warning: data definition has no type or storage class
    4 | int sum[MAX_V + 1];
      |     ^~~
main.c:4:5: error: type defaults to 'int' in declaration of 'sum' [-Wimplicit-int]
main.c:4:5: error: variably modified 'sum' at file scope
main.c:2:13: warning: data definition has no type or storage class
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:5:1: note: in expansion of macro 'int'
    5 | int main(){
      | ^~~
main.c:2:13: error: type defaults to 'int' in declaration of 'MAX_V' [-Wimplicit-int]
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:5:1: note: in expansion of macro 'int'
    5 | int main(){
      | ^~~
main.c:2:13: error: redefinition of 'MAX_V'
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:5:1: note: in expansion of macro 'int'
    5 | int main(){
      | ^~~
main.c:2:13: note: previous definition of 'MAX_V' with type 'int'
    2 | #define int MAX_V = 10000;
      |             ^~~~~
main.c:3:1: note: in expansion of macro 'int'
    3 | int prime[MAX_V + 1];
      | ^~~
main.c:5:5: error: return type defaults to 'int' [-Wimplicit-int]
    5 | int main(){
      |     ^~~~
main.c: In function 'main':
main.c:6:7: error: 'n' undeclared (first use in this function)
    6 |   int n, i, k;
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:10: error: 'i' undeclared (first use in this function)
    6 |   int n, i, k;
      |          ^
main.c:6:13: error: 'k' undeclared (first use in this function)
    6 |   int n, i, k;
      |             ^