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

#include<stdio.h>

#include<stdllib.h>

#include<string.h>

int main(void){

char num_str[1002];

int num;

long sum = 0;

int i;

char tmp;

while(1){

fgets(num_str, sizeof(num_str), stdin);

if(num_str[0] == '0') break;

for(i=0;i<strlen(num_str)-1;i++){

tmp=num_str[i];

num=atoi(&tmp);

sum=sum+num;

}

printf("%ld\n",sum);

sum=0;

memset(num_str, 1002, 0);

}

return 0;

}

Compiler output:
main.c:3:9: fatal error: stdllib.h: No such file or directory
    3 | #include<stdllib.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main(void){

int a[1000];

int x,sum,i;

sum =0;

inm:

fgets(a,sizeof(a),stdin);

if(a[0]==0){

goto end;

};

for(i=0;i<=1000;i++){

sum = sum +a[i];

};

printf("%d",sum);

};

goto inm;

end:

return 0;

};

Compiler output:
main.c: In function 'main':
main.c:13:7: error: passing argument 1 of 'fgets' from incompatible pointer type [-Wincompatible-pointer-types]
   13 | fgets(a,sizeof(a),stdin);
      |       ^
      |       |
      |       int *
In file included from main.c:1:
/usr/include/stdio.h:654:38: note: expected 'char * restrict' but argument is of type 'int *'
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |                     ~~~~~~~~~~~~~~~~~^~~
main.c:17:1: error: label 'end' used but not defined
   17 | goto end;
      | ^~~~
main.c: At top level:
main.c:31:1: error: expected identifier or '(' before 'goto'
   31 | goto inm;
      | ^~~~
main.c:33:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   33 | end:
      |    ^
main.c:37:1: error: expected identifier or '(' before '}' token
   37 | };
      | ^
Language: C

#include <stdio.h>

int main(void){

int a[1000];

int x,sum,i;

sum =0;

inm:

fgets(a,sizeof(a),stdin);

if(a[0]==0){

goto owari;

};

for(i=0;i<=1000;i++){

sum = sum +a[i];

};

printf("%d",sum);

};

goto inm;

owari:

return 0;

};

Compiler output:
main.c: In function 'main':
main.c:13:7: error: passing argument 1 of 'fgets' from incompatible pointer type [-Wincompatible-pointer-types]
   13 | fgets(a,sizeof(a),stdin);
      |       ^
      |       |
      |       int *
In file included from main.c:1:
/usr/include/stdio.h:654:38: note: expected 'char * restrict' but argument is of type 'int *'
  654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      |                     ~~~~~~~~~~~~~~~~~^~~
main.c:17:1: error: label 'owari' used but not defined
   17 | goto owari;
      | ^~~~
main.c: At top level:
main.c:31:1: error: expected identifier or '(' before 'goto'
   31 | goto inm;
      | ^~~~
main.c:33:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   33 | owari:
      |      ^
main.c:37:1: error: expected identifier or '(' before '}' token
   37 | };
      | ^
Language: C

#include <stdio.h>

int main(void){

  char num[1000];
  int a, ii;
  int i = 0;
  long long m = 0;

  for(ii = 0; ii < 1000; ii++){
    num[ii] = '0';
  }
  
  for(ii = 0; ii > -1; ii++){
    scanf("%s", num);
    a = num[0] - 48;
    if(a == 0) return 0;
    while(i < 1000){
      if(num[i] == 0) num[i] = '0'; 
      a = num[i] - 48;y
      m += num[i] - 48;
      num[i] = '0';
      i++;
    }
    printf("%lld\n", m);
    m = 0;
    i = 0;
  }
}

Compiler output:
main.c: In function 'main':
main.c:20:23: error: unknown type name 'y'
   20 |       a = num[i] - 48;y
      |                       ^
main.c:21:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+=' token
   21 |       m += num[i] - 48;
      |         ^~
Language: C

#include<stdio.h>

#include<stdlib.h>


#include<string.h>


int main(void)


{


char num_str[1002];


int num;


long sum = 0;


int i;


char tmp;


while (1)


{


fgets(num_str,sizeof(num_str),stdin);


if (num_str[0] == '0')break;


for(i = 0; i < strlen(num_str)-1; i++)


{


tmp = num_str[i];


num = atoi(&tmp);


sum = sum + num;


}


prinyf("%d\n", sum);


sum = 0;


memset(num_str, 1002,0);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:60:1: error: implicit declaration of function 'prinyf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   60 | prinyf("%d\n", sum);
      | ^~~~~~
      | printf
Language: C

#include<stdio.h>

#include<stdlib.h>


#include<string.h>


int main(void)


{


char num_str[1002];


int num;


long sum = 0;


int i;


char tmp;


while (1)


{


fgets(num_str,sizeof(num_str),stdin);


if (num_str[0] == '0')break;


for(i = 0; i < strlen(num_str)-1; i++)


{


tmp = num_str[i];


num = atoi(&tmp);


sum = sum + num;


}


prinyf("%ld\n", sum);


sum = 0;


memset(num_str, 1002,0);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:60:1: error: implicit declaration of function 'prinyf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   60 | prinyf("%ld\n", sum);
      | ^~~~~~
      | printf
Language: C

#include<stdio.h>
int main(void)
{
    int i,n;
    int number;
    int sum=0;
    int min=0;
    int max=0;
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
        scanf("%d",&number);
        
        if(i==0)
        {
         min = number;
         max = number;
         
       }
       if(number<min) min = number;
       if(number>max) max = number;  
       
       sum+ = number;
       }
       printf("%d %d %d\n",min,max.sum);
       
       return 0;
       
       }
       

Compiler output:
main.c: In function 'main':
main.c:24:13: error: expected expression before '=' token
   24 |        sum+ = number;
      |             ^
main.c:26:35: error: request for member 'sum' in something not a structure or union
   26 |        printf("%d %d %d\n",min,max.sum);
      |                                   ^
Language: C

#include<stdio.h>


#include<stdlib.h>


#include<string.h>


int main(void)


{


char num_str[1002];


int num;


long sum = 0;


int i;


char tmp;


while (1)


{


fgets(num_str,sizeof(num_str),stdin);


if (num_str[0] == '0') break;


for (i = ; i < strlen(num_str)-1; i++)


{


tmp = num_str[i];


num = atoi(&tmp);


sum = sum + num+


}


printf("%ld\n",sum);


sum = 0;


memset(num_str,1002,0);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:43:10: error: expected expression before ';' token
   43 | for (i = ; i < strlen(num_str)-1; i++)
      |          ^
main.c:58:1: error: expected expression before '}' token
   58 | }
      | ^
Language: C

#include<stdio.h>


#include<stdlib.h>


#include<string.h>


int main(void)


{


char num_str[1002];


int num;


long sum = 0;


int i;


char tmp;


while (1)


{


fgets(num_str,sizeof(num_str),stdin);


if (num_str[0] == '0') break;


for (i = 0; i < strlen(num_str)-1; i++)


{


tmp = num_str[i];


num = atoi(&tmp);


sum = sum + num+


}


printf("%ld\n",sum);


sum = 0;


memset(num_str,1002,0);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:58:1: error: expected expression before '}' token
   58 | }
      | ^
Language: C

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

int main(void)

{

    int i,a,gokei;

    char b,suti,[1000];

    while(1){ 

     gokei=0;

     scanf("%s",suti);

     if(suti[0]=='0'){

      break;

     }

    a=strlen(suti);

    for(i=0;i<a;i++){

     b=suti{i};

     gokei+=atoi(&b);

    }

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

    }

    return 0;

}




   

    

Compiler output:
main.c: In function 'main':
main.c:13:17: error: expected identifier or '(' before '[' token
   13 |     char b,suti,[1000];
      |                 ^
main.c:21:13: error: subscripted value is neither array nor pointer nor vector
   21 |      if(suti[0]=='0'){
      |             ^
main.c:27:14: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   27 |     a=strlen(suti);
      |              ^~~~
      |              |
      |              char
In file included from main.c:3:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:31:12: error: expected ';' before '{' token
   31 |      b=suti{i};
      |            ^
      |            ;
Language: C

#include<stdio.h>

#include<string.h>


#include<stdlib.h>


int main(void)


{


   int i,a,gokei;


   char b,suti[1000];


   while(1){


                 gokei=0;


                 scanf("%s",suti);


                 if(suti[0] == '0'){


                    break;


                 }


                 a=strlein(suti);


                 for(i=0;i<a;i++){


                       b=suti[i]+


                       gokei+=atoi(&b);


                   }


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


                 }


       return 0;


  }

Compiler output:
main.c: In function 'main':
main.c:39:20: error: implicit declaration of function 'strlein'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   39 |                  a=strlein(suti);
      |                    ^~~~~~~
      |                    strlen
main.c:48:29: error: lvalue required as left operand of assignment
   48 |                        gokei+=atoi(&b);
      |                             ^~
Language: C

#include<stdio.h>

#include<stdib.h>


#include<string.h>


int main(void){





char num_str[1002];


int num;


long sum = 0;


int i;


char tmp;


while (1){


fgets(num_str,sizeof(num_str),stdin);


if(num_str[0] == '0') break;


for(i=0;i<strlen(num_str)-1;i++){


tmp = num_str[i];


num=atoi(&tmp);


sum=sum+num;


}


printf("%ld\n",sum);


sum=0;


memset(num_str,1002,0);


}


return 0;


}

Compiler output:
main.c:3:9: fatal error: stdib.h: No such file or directory
    3 | #include<stdib.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

int main(void)

{

   int sum,num;

   char x;

   scanf("%c",&x);

   char num[1000];


   sum+=num[i]-`0`;


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


       return 0;

  }

Compiler output:
main.c: In function 'main':
main.c:13:9: error: conflicting types for 'num'; have 'char[1000]'
   13 |    char num[1000];
      |         ^~~
main.c:7:12: note: previous declaration of 'num' with type 'int'
    7 |    int sum,num;
      |            ^~~
main.c:16:13: error: 'i' undeclared (first use in this function)
   16 |    sum+=num[i]-`0`;
      |             ^
main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:16: error: stray '`' in program
   16 |    sum+=num[i]-`0`;
      |                ^
main.c:16:18: error: stray '`' in program
   16 |    sum+=num[i]-`0`;
      |                  ^
Language: C

#include <stdio.h>

int main(void)

{

    int i,a,sum;
	char x,num[1001]c;
	
    while(1){ 
     sum=0;
     scanf("%c",num);
     if(num[0]=='0'){
      break;
     }
     for(i=0;i<=1001;i++){
      sum+=num[i]-'0';
     }

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

}

Compiler output:
main.c: In function 'main':
main.c:8:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'c'
    8 |         char x,num[1001]c;
      |                         ^
main.c:12:17: error: 'num' undeclared (first use in this function); did you mean 'sum'?
   12 |      scanf("%c",num);
      |                 ^~~
      |                 sum
main.c:12:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#include<stdlib.h>


#include<string.h>


int main(void)


{


    char num_str[1002];


    int num;


    long sum;


    int i;


    char tmp;


    sum=0;


    while(1){


             fgets(num_str,sizeof(num_str),stdin);


             if(num_str[0]==`0`)break;


             for(i=0;i<strlen(num_str)-1; i++)


             {


                  tmp=num_str[i];


                  num=atoi(&tmp);


                  sum+=num;


               }


           printf("%ld\n",sum);


           sum=0;


           memset(num_str,1002,0);


 }


 return 0;


}

Compiler output:
main.c: In function 'main':
main.c:39:29: error: stray '`' in program
   39 |              if(num_str[0]==`0`)break;
      |                             ^
main.c:39:31: error: stray '`' in program
   39 |              if(num_str[0]==`0`)break;
      |                               ^
Language: C

#include<stdio.h>

#include<stdlib.h>


#include<string.h>


int main(void)


char num_str[1002];


int num;


long sum=0;


int i;


char tmp;


while(1)


{


fgets(num_str,sizrof(num_str),stdin);


if(num_str[0]=='0')break;


for(i=0;i<strlen(num_str)-1; i++)


{


tmp=num_str[i];


num=atoi(&tmp);


sum=sum+num;


}


printf("%ld\n",sum);


sum=0;


memset(num_str,1002,0);


}


return


}

Compiler output:
main.c: In function 'main':
main.c:18:1: error: parameter 'sum' is initialized
   18 | long sum=0;
      | ^~~~
main.c:27:1: error: expected declaration specifiers before 'while'
   27 | while(1)
      | ^~~~~
main.c:69:1: error: expected declaration specifiers before 'return'
   69 | return
      | ^~~~~~
main.c:9:5: error: old-style parameter declarations in prototyped function definition
    9 | int main(void)
      |     ^~~~
main.c:73: error: expected '{' at end of input
Language: C

#include<stdio.h>

#include<stdlib.h>


#include<string.h>


int main(void){


char num_str[1002];


int num;


long sum=0;


int i;


char tmp;


while(1)


{


fgets(num_str,sizrof(num_str),stdin);


if(num_str[0]=='0')break;


for(i=0;i<strlen(num_str)-1; i++)


{


tmp=num_str[i];


num=atoi(&tmp);


sum=sum+num;


}


printf("%ld\n",sum);


sum=0;


memset(num_str,1002,0);


}


return


}

Compiler output:
main.c: In function 'main':
main.c:33:15: error: implicit declaration of function 'sizrof' [-Wimplicit-function-declaration]
   33 | fgets(num_str,sizrof(num_str),stdin);
      |               ^~~~~~
main.c:72:1: error: expected expression before '}' token
   72 | }
      | ^
Language: C

#include<stdio.h>

#include<stdlib.h>


#include<string.h>


int main(void){


char num_str[1002];


int num;


long sum=0;


int i;


char tmp;


while(1)


{


fgets(num_str,sizrof(num_str),stdin);


if(num_str[0]=='0')break;


for(i=0;i<strlen(num_str)-1; i++)


{


tmp=num_str[i];


num=atoi(&tmp);


sum=sum+num;


}


printf("%ld\n",sum);


sum=0;


memset(num_str,1002,0);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:33:15: error: implicit declaration of function 'sizrof' [-Wimplicit-function-declaration]
   33 | fgets(num_str,sizrof(num_str),stdin);
      |               ^~~~~~
Language: C


#include <stdio.h>
 
int main()
???
  int i, sum;
  char k[1001];
 
  for (;;) {
    scanf("%s", k);
    if (k[0] == '0')
      break;
 
    sum = 0;
    for (i = 0; k[i] != '\0'; i++)
      sum += k[i] - '0';
    printf("%d\n", sum);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:1: error: expected declaration specifiers before '?' token
    5 | ???
      | ^
main.c:9:3: error: expected declaration specifiers before 'for'
    9 |   for (;;) {
      |   ^~~
main.c:9:9: error: expected declaration specifiers before ';' token
    9 |   for (;;) {
      |         ^
main.c:9:10: error: expected declaration specifiers before ')' token
    9 |   for (;;) {
      |          ^
main.c:19:3: error: expected declaration specifiers before 'return'
   19 |   return 0;
      |   ^~~~~~
main.c:20:1: error: expected declaration specifiers before '}' token
   20 | }
      | ^
main.c:7:8: error: declaration for parameter 'k' but no such parameter
    7 |   char k[1001];
      |        ^
main.c:21: error: expected '{' at end of input
Language: C

#include <stdio.h>
 
int main()
???
  int i, sum;
  char k[1001];
 
  for (;;) {
    scanf("%s", k);
    if (k[0] == '0')
      break;
 
    sum = 0;
    for (i = 0; k[i] != '\0'; i++)
      sum += k[i] - '0';
    printf("%d\n", sum);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: expected declaration specifiers before '?' token
    4 | ???
      | ^
main.c:8:3: error: expected declaration specifiers before 'for'
    8 |   for (;;) {
      |   ^~~
main.c:8:9: error: expected declaration specifiers before ';' token
    8 |   for (;;) {
      |         ^
main.c:8:10: error: expected declaration specifiers before ')' token
    8 |   for (;;) {
      |          ^
main.c:18:3: error: expected declaration specifiers before 'return'
   18 |   return 0;
      |   ^~~~~~
main.c:19:1: error: expected declaration specifiers before '}' token
   19 | }
      | ^
main.c:6:8: error: declaration for parameter 'k' but no such parameter
    6 |   char k[1001];
      |        ^
main.c:20: error: expected '{' at end of input
Language: C

#include <stdio.h>
int main(void){

int n,i,ai,min,max,;
long sum;

sum=0;
min=1000000;
max=-1000000;
scanf("%d",%n);
for(i=1;i<n;i++){
scanf("%d",&ai);
sum+=ai;
if(min>ai){
min=ai;
}
if(max<ai){
max=ai;
}
}
printf("%d %d %lld\n",min,max,sum);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: expected identifier or '(' before ';' token
    4 | int n,i,ai,min,max,;
      |                    ^
main.c:10:12: error: expected expression before '%' token
   10 | scanf("%d",%n);
      |            ^
Language: C

#include <stdio.h>
int main(void){

int n,i,ai,min,max;
long sum;

sum=0;
min=1000000;
max=-1000000;
scanf("%d",%n);
for(i=1;i<n;i++){
scanf("%d",&ai);
sum+=ai;
if(min>ai){
min=ai;
}
if(max<ai){
max=ai;
}
}
printf("%d %d %lld\n",min,max,sum);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:12: error: expected expression before '%' token
   10 | scanf("%d",%n);
      |            ^
Language: C

#include <stdio.h>

#include<stdlib.h>

#include<string.h>



int main(void){

char num_str[1002]

int num;

long sum=0;

int i;

char tmp;



while(1){

fgets(num_str, sizeof(num_str), stdin);



if (num_str[0]=='0') break;



for (i=0; i<strlen(num_str)-1;i++){

tmp=num_str[i];

num =atoi(&tmp);

sum=sum+num;

};

printf("%ld\n",sum);



sum=0;

memset(num_str,1002,0);

};

return 0;

};

Compiler output:
main.c: In function 'main':
main.c:11:19: error: expected ';' before 'int'
   11 | char num_str[1002]
      |                   ^
      |                   ;
   12 | 
   13 | int num;
      | ~~~                
main.c:25:7: error: 'num_str' undeclared (first use in this function)
   25 | fgets(num_str, sizeof(num_str), stdin);
      |       ^~~~~~~
main.c:25:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main(void){
char num_str[1002];
int num;
long sum = 0;
char tmp;

while (1){
fgets(num_str,sizeof(num_str),stdin);
if (num_str[0] =='0') break;
for (i = 0; i < strlen(num_str)-1; i++){
tmp = num_str[1];
num = atoi(&tmp);
sum - sum + num;
}
printf("%ld\n",sum);
sum = 0;
memset(num_str,1002, 0);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:6: error: 'i' undeclared (first use in this function)
   14 | for (i = 0; i < strlen(num_str)-1; i++){
      |      ^
main.c:14:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){

while(1){


char x;


int s=0;


scanf("%d",&x);


while(x!='\n'){


sum+=x-'0';


scanf("%c",&x);


}


if(s==0){


break;


}


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


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:20:1: error: 'sum' undeclared (first use in this function)
   20 | sum+=x-'0';
      | ^~~
main.c:20:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<string.h>

int main(void)

 {  

char num_str[1002]; 

int num;  

long sum=0; 

int i;  char tmp;    

while(1) 

{   

fgets(num_str,sizeof(num_str),stdin);      

if(num_str[0]=='0')break;      

for(i=0;i<strlen(num_str)-1;i++)   

{    

tmp=num_str[i];   

num=atoi(&tmp);    

sum=sum+num;       

}     

printf("%lf\n",sum);      

sum=0;   

memset(num_str,1002,0);  

}  

return 0; 

}

Compiler output:
main.c: In function 'main':
main.c:19:1: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
   19 | fgets(num_str,sizeof(num_str),stdin);
      | ^~~~~
main.c:19:31: error: 'stdin' undeclared (first use in this function)
   19 | fgets(num_str,sizeof(num_str),stdin);
      |                               ^~~~~
main.c:2:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
    1 | #include<string.h>
  +++ |+#include <stdio.h>
    2 | 
main.c:19:31: note: each undeclared identifier is reported only once for each function it appears in
   19 | fgets(num_str,sizeof(num_str),stdin);
      |                               ^~~~~
main.c:29:5: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   29 | num=atoi(&tmp);
      |     ^~~~
main.c:35:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   35 | printf("%lf\n",sum);
      | ^~~~~~
main.c:35:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:35:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:35:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>


int main(void){
	
	int x,a,b,c,d,e;
	scanf("%d",&x);
	if(x==0&&x=>10000){
	
	}else{
		
		a=x/1000;
	b=(x-a*1000)/100;
	c=(x-a*1000-b*100)/10;
	d=(x-a*1000-b*100-c*10);
	e=a+c+b+d;
	printf("%d\n",e);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:20: error: expected expression before '>' token
    8 |         if(x==0&&x=>10000){
      |                    ^
Language: C

#include<stdio.h>
int main(void){
	int  a,b,A,B,C,D,F,G,H,I;
	for(i=0;H!=0;i++){
		scanf("%d",&A);
		a=A/10000;
		b=A%10000;
		B=b/1000;
		C=b%1000;
		D=C/100;
		F=C%100;
		G=F/10;
		I=F%10;
		H=a+B+D+G+I;
		printf("%d\n",H);
	}
	return 0;
}

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

#include <stdio.h>

int main(void)
{
	char num[1001];
	
	int a, sum;
	
	while(1){
		
		scanf("%s" ,num);
		
		if(num[0]=='0')break;
		
		sum = 0;
		
		for(i = 0;num[a]!='\0';i++){
			
			sum+=num[a]-'0';
			
		}
		
		printf("%d\n" ,sum);
		
	}
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:17:21: error: 'i' undeclared (first use in this function)
   17 |                 for(i = 0;num[a]!='\0';i++){
      |                     ^
main.c:17:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>





int main(void)


 char str[1010];


int i,sum;





scanf("%s",str);


 while(str[0]!='0'){


 i=0; sum=0;


while(str[i]){


 sum+=str[i]-'0';i++;


}


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


scanf("%s",str);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:19:1: error: expected declaration specifiers before 'scanf'
   19 | scanf("%s",str);
      | ^~~~~
main.c:22:2: error: expected declaration specifiers before 'while'
   22 |  while(str[0]!='0'){
      |  ^~~~~
main.c:46:1: error: expected declaration specifiers before 'return'
   46 | return 0;
      | ^~~~~~
main.c:49:1: error: expected declaration specifiers before '}' token
   49 | }
      | ^
main.c:7:5: error: old-style parameter declarations in prototyped function definition
    7 | int main(void)
      |     ^~~~
main.c:50: error: expected '{' at end of input
Language: C

#include <stdio.h>
int main (void){
   char a[1000] ;
    int i,b=0 ;
do{
for (i=1 ;i<=1000 ;i++){
   scanf("%c",&a[i]);
  b+=atoi(&a[i]);
if(a[i]=='\n'){
break ;
        }
}
}while(a[0]!=0)
printf("%d\n",b) ;
return 0 ;
}

Compiler output:
main.c: In function 'main':
main.c:8:6: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
    8 |   b+=atoi(&a[i]);
      |      ^~~~
main.c:13:16: error: expected ';' before 'printf'
   13 | }while(a[0]!=0)
      |                ^
      |                ;
   14 | printf("%d\n",b) ;
      | ~~~~~~
Language: C

#include <stdio.h>
int main (void){
   char a[1001] ;
    int i,b=0 ;
while(1){{
scanf("%s",&a);
if(a[0]==0){
break ;}
for(i=0;i<=1000;i++){
b+=a[i];
}

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

Compiler output:
main.c: In function 'main':
main.c:15:1: error: expected declaration or statement at end of input
   15 | }
      | ^
main.c:15:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>
int main (void){
   char a[1001] ;
    int i,b=0 ;
while(1){
scanf("%s",&a);
b=0;
if(a[0]=='0'){
break ;}
for(i=0;i<=1000;i++){
b+=atoi(&a[i]);
}printf("%d\n",b) ;}


return 0 ;

Compiler output:
main.c: In function 'main':
main.c:11:4: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   11 | b+=atoi(&a[i]);
      |    ^~~~
main.c:15:1: error: expected declaration or statement at end of input
   15 | return 0 ;
      | ^~~~~~
Language: C

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main(void)

{

char num_str[1002];

int num;

long sum = 0;

int i;

char tmp;


while (1)

{

fgets(num_str,sizeof(num_str),stdim);


if (num_str[0] == '0') break;


for (i = 0; i < strlen(num_str)-1; i++)

{

tmp = num_str[i];

num   = atoi(&tmp);

sum = sum + num;

}


printf("%ld\n", sum);


sum = 0;

memset(num_str, 1002,0);


}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:26:31: error: 'stdim' undeclared (first use in this function); did you mean 'stdin'?
   26 | fgets(num_str,sizeof(num_str),stdim);
      |                               ^~~~~
      |                               stdin
main.c:26:31: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main(void)

{

char num_str[1002];

int num;

long sum = 0;

int i;

	
int stdim = 0;
char tmp;


while (1)

{

gets(num_str,sizeof(num_str),stdim);


if (num_str[0] == '0') break;


for (i = 0; i < strlen(num_str)-1; i++)

{

tmp = num_str[i];

num   = atoi(&tmp);

sum = sum + num;

}


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


sum = 0;

memset(num_str, 1002,0);


}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:28:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   28 | gets(num_str,sizeof(num_str),stdim);
      | ^~~~
      | fgets
Language: C

char tmp;    while (1)  {   fgets(num_str, sizeof(num_str), stdin);      if (num_str[0] == '0') break;      for (i = 0; i < strlen(num_str)-1; i++)   {    tmp = num_str[i];    num = atoi(&tmp);    sum = sum + num;   }      printf("%ld\n", sum);      sum=0;   memset(num_str, 1002,0);  }    return 0; }

Compiler output:
main.c:1:14: error: expected identifier or '(' before 'while'
    1 | char tmp;    while (1)  {   fgets(num_str, sizeof(num_str), stdin);      if (num_str[0] == '0') break;      for (i = 0; i < strlen(num_str)-1; i++)   {    tmp = num_str[i];    num = atoi(&tmp);    sum = sum + num;   }      printf("%ld\n", sum);      sum=0;   memset(num_str, 1002,0);  }    return 0; }
      |              ^~~~~
main.c:1:291: error: expected identifier or '(' before 'return'
    1 | char tmp;    while (1)  {   fgets(num_str, sizeof(num_str), stdin);      if (num_str[0] == '0') break;      for (i = 0; i < strlen(num_str)-1; i++)   {    tmp = num_str[i];    num = atoi(&tmp);    sum = sum + num;   }      printf("%ld\n", sum);      sum=0;   memset(num_str, 1002,0);  }    return 0; }
      |                                                                                                                                                                                                                                                                                                   ^~~~~~
main.c:1:301: error: expected identifier or '(' before '}' token
    1 | char tmp;    while (1)  {   fgets(num_str, sizeof(num_str), stdin);      if (num_str[0] == '0') break;      for (i = 0; i < strlen(num_str)-1; i++)   {    tmp = num_str[i];    num = atoi(&tmp);    sum = sum + num;   }      printf("%ld\n", sum);      sum=0;   memset(num_str, 1002,0);  }    return 0; }
      |                                                                                                                                                                                                                                                                                                             ^
Language: C

char tmp; 
   while (1)
  { 
  fgets(num_str, sizeof(num_str), stdin);
      if (num_str[0] == '0')
 break; 
     for (i = 0; i < strlen(num_str)-1; i++) 
  {  
  tmp = num_str[i]; 
   num = atoi(&tmp); 
   sum = sum + num;  
 }    

  printf("%ld\n", sum);  
    sum=0;   
memset(num_str, 1002,0);
  }    
return 0; 
}

Compiler output:
main.c:2:4: error: expected identifier or '(' before 'while'
    2 |    while (1)
      |    ^~~~~
main.c:18:1: error: expected identifier or '(' before 'return'
   18 | return 0;
      | ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C

#include<stdio.h>
#include<sutdlib.h>
#include<string.h>
int main(void)
{
char num_str[1002];
int num;
long sum = 0;
int i;
char tmp;

    while (1)

  {   fgets(num_str, sizeof(num_str), stdin);      if (num_str[0] == '0') break;      for (i = 0; i < strlen(num_str)-1; i++)   {    tmp = num_str[i];    num = atoi(&tmp);    sum = sum + num;   }      printf("%ld\n", sum);      sum=0;   memset(num_str, 1002,0);  }    return 0; }

Compiler output:
main.c:2:9: fatal error: sutdlib.h: No such file or directory
    2 | #include<sutdlib.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<sutdlib.h>
#include<string.h>
int main(void)
{
char num_str[1002];
int num;
long sum = 0;
int i;
char tmp;

    while (1)

  {
   fgets(num_str, sizeof(num_str), stdin);
      if (num_str[0] == '0')
 break; 
     for (i = 0; i < strlen(num_str)-1; i++)  
 {  
  tmp = num_str[i];
    num = atoi(&tmp); 
   sum = sum + num; 
  }    
  printf("%ld\n", sum); 
     sum=0;   
memset(num_str, 1002,0); 
 }   
 return 0; 
}

Compiler output:
main.c:2:9: fatal error: sutdlib.h: No such file or directory
    2 | #include<sutdlib.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

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

intmain(void)
{
	char num_str[1002];
	int num;
	long sum =0;
	int i;
	char tmp;
	
	while (1)
	{
		fgets(num_str, sizeof(num_str), stdin);
		
		if (num_str[0] == '0') break;
		for(i = 0; i < strlen(num_str)-1; i++)
		{
			tmp = num_str[i];
			num = atoi(&tmp);
			sum = sum + num;
		}
		printf("%ld\n",sum);
		
		sum = 0;
		memeset(num_str, 1002, 0);
	}
	return 0;
}

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | intmain(void)
      | ^~~~~~~
main.c: In function 'intmain':
main.c:27:17: error: implicit declaration of function 'memeset'; did you mean 'memset'? [-Wimplicit-function-declaration]
   27 |                 memeset(num_str, 1002, 0);
      |                 ^~~~~~~
      |                 memset
Language: C

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

intmain(void)
{
	char num_str[1002];
	int num;
	long sum =0;
	int i;
	char tmp;
	
	while (1)
	{
		fgets(num_str, sizeof(num_str), stdin);
		
		if (num_str[0] == '0') break;
		for(i = 0; i < strlen(num_str)-1; i++)
		{
			tmp = num_str[i];
			num = atoi(&tmp);
			sum = sum + num;
		}
		printf("%ld\n",sum);
		
		sum = 0;
		memset(num_str, 1002, 0);
	}
	return 0;
}

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | intmain(void)
      | ^~~~~~~
Language: C

#include<stdio.h>

#include<string.h>


int main(void)


{


int sum;


char str[1100];


int i;


for(i=0;i<1100;i++){


str[i]=0;


}


while(1){


scanf("%s",str);


if(strcmp(str,"0")==0{


break;


}


sum=0;


for(i=0;str[i]!='\0';i++){


sum+=str[i]-'0';


}


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


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:36:22: error: expected ')' before '{' token
   36 | if(strcmp(str,"0")==0{
      |   ~                  ^
      |                      )
main.c:60:1: error: expected expression before '}' token
   60 | }
      | ^
Language: C

#include<stdio.h>

#include<stdio.h>

int main(void)


{


char num_str[1002];


int num;


long sum=0;


int i;


int stdim=0;char tmp


while(1)


{


fgets(num_str,sizeof(num_str),stdin);


if(num_str[0]=='0')break;


for(i=0;i<strlen(num_str,1001,0);


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:26:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'while'
   26 | while(1)
      | ^~~~~
main.c:38:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   38 | for(i=0;i<strlen(num_str,1001,0);
      |           ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:38:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   38 | for(i=0;i<strlen(num_str,1001,0);
      |           ^~~~~~
main.c:38:11: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:38:11: error: too many arguments to function 'strlen'
main.c:41:1: error: expected expression before '}' token
   41 | }
      | ^
main.c:41:1: error: expected expression before '}' token
Language: C

#include<stdio.h>

#include<string.h>


int main(void){


int num,i,,count,sum;


char number[1001];


char*str;


while(1){


scanf("%s",number);


i=0;


sum=0;


str=&number;


count=(int)strlen(str);


if(number[0]=='0'){


if(count==1){


break;


}


}


while(i<count){


num=number[i]-'0';


sum=sum+num;


i++;


}


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


}


return 0;



}

Compiler output:
main.c: In function 'main':
main.c:9:11: error: expected identifier or '(' before ',' token
    9 | int num,i,,count,sum;
      |           ^
main.c:27:1: error: 'sum' undeclared (first use in this function); did you mean 'num'?
   27 | sum=0;
      | ^~~
      | num
main.c:27:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:4: error: assignment to 'char *' from incompatible pointer type 'char (*)[1001]' [-Wincompatible-pointer-types]
   30 | str=&number;
      |    ^
main.c:33:1: error: 'count' undeclared (first use in this function)
   33 | count=(int)strlen(str);
      | ^~~~~
Language: C

#include<stdio.h>
  
int main()
{
    while
    {
        char num[1001];
        scanf("%s", num);
        if (num[0] == '0') break;
        int n, sum = 0;
        for (n = 0; num[n] != '\0'; n++)
        {
            sum += num[n] - '0';
        }
        printf("%d\n", sum);
    }
  
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: expected '(' before '{' token
    6 |     {
      |     ^
      |     (
main.c:8:21: error: 'num' undeclared (first use in this function)
    8 |         scanf("%s", num);
      |                     ^~~
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main (void){
	char a ;
	int a=0,sum=0;
	while(a==0){
		while((a=getchar())!='\0'){
			sum+=atoi(&a);}
		
		if(sum==0){
			break ;}
		else{printf("%d\n",sum);}}
return 0;
	}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: conflicting types for 'a'; have 'int'
    4 |         int a=0,sum=0;
      |             ^
main.c:3:14: note: previous declaration of 'a' with type 'char'
    3 |         char a ;
      |              ^
main.c:7:30: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
    7 |                         sum+=atoi(&a);}
      |                              ^~~~
Language: C

#include <stdio.h>
int main (void){
	char a[1001] ;
	int b=0,sum=0;
	while(b==0){
		scanf("%s",a);
		for(int i=0 ;i<1001;i++){
                       sum+=atoi(&a[i]);}
		if(sum==0){
			b++;}
		else{printf("%d\n",sum);}}
return 0;
	}

Compiler output:
main.c: In function 'main':
main.c:8:29: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
    8 |                        sum+=atoi(&a[i]);}
      |                             ^~~~
Language: C

#include<stdio.h>
??
#include<string.h>
??
??
#include<stdlib.h>
??
??
int main(void)
??
??
{
??
??
??int i, a, gokei;
??
??
??char b, suti[1000];
??
??
??while(1){
??
??
????gokei=0;
??
??
????scanf("%s",suti);
??
??
????if(suti[0] == '0'){
??
??
??????break;
??
??
????}
??
??
????a=strlen(suti);
??
??
????for(i=0; i<a; i++){
??
??
??????b=suti[i];
??
??
??????gokei+=atoi(&b);
??
??
????}
??
??
????printf("%d\n",gokei);
??
??
??}
??
??
return 0;
??
??
}
??

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ??
      | ^
In file included from main.c:6:
/usr/include/stdlib.h:1065:20: error: unknown type name 'wchar_t'
 1065 | extern int mbtowc (wchar_t *__restrict __pwc,
      |                    ^~~~~~~
/usr/include/stdlib.h:707:1: note: 'wchar_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  706 | # include <alloca.h>
  +++ |+#include <stddef.h>
  707 | #endif /* Use misc.  */
/usr/include/stdlib.h:1069:31: error: unknown type name 'wchar_t'
 1069 | extern int wctomb (char *__s, wchar_t __wchar) __THROW;
      |                               ^~~~~~~
/usr/include/stdlib.h:1069:31: note: 'wchar_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1073:25: error: unknown type name 'wchar_t'
 1073 | extern size_t mbstowcs (wchar_t *__restrict  __pwcs,
      |                         ^~~~~~~
/usr/include/stdlib.h:1073:25: note: 'wchar_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:1078:31: error: unknown type name 'wchar_t'
 1078 |                         const wchar_t *__restrict __pwcs, size_t __n)
      |                               ^~~~~~~
/usr/include/stdlib.h:1078:31: note: 'wchar_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
main.c:7:1: error: expected identifier or '(' before '?' token
    7 | ??
      | ^
main.c:64:1: error: expected identifier or '(' before '?' token
   64 | ??
      | ^
Language: C

#include<stdio.h>




int main(void){

char str[1010];

int i,sum;

scanf("%s",str);

while(str[0]!='0'){

i=0; sum=0;

while(str[i]{

sum+=str[i]-'0';i++;

}

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

scanf("%s",str);

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:18:13: error: expected ')' before '{' token
   18 | while(str[i]{
      |      ~      ^
      |             )
main.c:28:1: error: expected expression before '}' token
   28 | }
      | ^
Language: C

#include<stdio.h>
int main(){
????char c[1000];
????int i,x;
????int sum;
????int co;
????while(1){
????????co=0;
????????sum=0;
????????scanf("%s",&c);
????????for(i=0;;i++){
????????????if(c[i]=='\0'){
????????co=i;
????????break;
????????????}
????????}
????????if(c[0]=='0')break;
????????????
????????for(i=0;i<co;i++){
????????????x =c[i]-'0';
????????????sum+=x;
????
????????}
????????printf("%d\n",sum);
????}
????????
????return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ????char c[1000];
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ????int i,x;
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ????int sum;
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????int co;
      | ^
main.c:7:1: error: expected expression before '?' token
    7 | ????while(1){
      | ^
Language: C

#include <stdio.h>
int main(){
????char num[1200];
????int sum=0, i=0, number;
??
????while(1){
????????scanf("%s",num);
????????if(num[0]=='0')break;
????????while(1){
????????????if(num[i]=='\0')break;
????????????number=num[i]-'0';
????????????sum=sum+number;
????????????i++;
????????}
????????printf("%d\n",sum);
????????sum=0;
????????i=0;
????}
????return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ????char num[1200];
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ????int sum=0, i=0, number;
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ??
      | ^
Language: C

#include<stdio.h>
int main(){
int i;
int sum=0;
char ch[1001];
while(1){
scanf("%s",ch);
if(ch[0]=='0')
break;
for(i=0;I<strlen(ch);i++){
sum+=ch[i]-'0';
}
printf("%d\n",sum);
sum=0;
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'I' undeclared (first use in this function)
   10 | for(i=0;I<strlen(ch);i++){
      |         ^
main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   10 | for(i=0;I<strlen(ch);i++){
      |           ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | int main(){
main.c:10:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   10 | for(i=0;I<strlen(ch);i++){
      |           ^~~~~~
main.c:10:11: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C

#include<string.h>

#include<stdio.h>


int main(void)


{


int i,sum=0;


int flag=0;


char x=[1002];


scanf("%s",x);


do


{


for(i=0;i<1002;i++){


if(x[i]==0){


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


break;


}else{


sum+=x[i]-0x30;


}


}


sum=0;


scanf("%s",x);


}while(x[0]!=0x309;


return 0;}

Compiler output:
main.c: In function 'main':
main.c:18:8: error: expected expression before '[' token
   18 | char x=[1002];
      |        ^
main.c:33:5: error: subscripted value is neither array nor pointer nor vector
   33 | if(x[i]==0){
      |     ^
main.c:45:7: error: subscripted value is neither array nor pointer nor vector
   45 | sum+=x[i]-0x30;
      |       ^
main.c:60:9: error: subscripted value is neither array nor pointer nor vector
   60 | }while(x[0]!=0x309;
      |         ^
main.c:60:19: error: expected ')' before ';' token
   60 | }while(x[0]!=0x309;
      |       ~           ^
      |                   )
main.c:63:10: error: expected ';' before '}' token
   63 | return 0;}
      |          ^
      |          ;
main.c:63:1: error: expected declaration or statement at end of input
   63 | return 0;}
      | ^~~~~~
Language: C

#include<string.h>

#include<stdio.h>

int main(void)

{

int i,sum=0;

int flag=0;

char x=[1002];

scanf("%s",x);

do

{

for(i=0;i<1002;i++){

if(x[i]==0){

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

break;

}else{

sum+=x[i]-0x30;

}

}

sum=0;

scanf("%s",x);

}while(x[0]!=0x309;

return 0;}

Compiler output:
main.c: In function 'main':
main.c:13:8: error: expected expression before '[' token
   13 | char x=[1002];
      |        ^
main.c:23:5: error: subscripted value is neither array nor pointer nor vector
   23 | if(x[i]==0){
      |     ^
main.c:31:7: error: subscripted value is neither array nor pointer nor vector
   31 | sum+=x[i]-0x30;
      |       ^
main.c:41:9: error: subscripted value is neither array nor pointer nor vector
   41 | }while(x[0]!=0x309;
      |         ^
main.c:41:19: error: expected ')' before ';' token
   41 | }while(x[0]!=0x309;
      |       ~           ^
      |                   )
main.c:43:10: error: expected ';' before '}' token
   43 | return 0;}
      |          ^
      |          ;
main.c:43:1: error: expected declaration or statement at end of input
   43 | return 0;}
      | ^~~~~~
Language: C

#include<string.h>

#include<stdio.h>

int main(void)

{

int i,sum=0;

int flag=0;

char x[1002];

scanf("%s",x);

do

{

for(i=0;i<1002;i++){

if(x[i]==0){

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

break;

}else{

sum+=x[i]-0x30;

}

}

sum=0;

scanf("%s",x);

}while(x[0]!=0x309;

return 0;}
#include<string.h>

#include<stdio.h>

int main(void)

{

int i,sum=0;

int flag=0;

char x[1002];

scanf("%s",x);

do

{

for(i=0;i<1002;i++){

if(x[i]==0){

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

break;

}else{

sum+=x[i]-0x30;

}

}

sum=0;

scanf("%s",x);

}while(x[0]!=0x309;

return 0;}

Compiler output:
main.c: In function 'main':
main.c:41:19: error: expected ')' before ';' token
   41 | }while(x[0]!=0x309;
      |       ~           ^
      |                   )
main.c:43:10: error: expected ';' before '}' token
   43 | return 0;}
      |          ^
      |          ;
main.c: In function 'main':
main.c:84:19: error: expected ')' before ';' token
   84 | }while(x[0]!=0x309;
      |       ~           ^
      |                   )
main.c:86:10: error: expected ';' before '}' token
   86 | return 0;}
      |          ^
      |          ;
main.c:86:1: error: expected declaration or statement at end of input
   86 | return 0;}
      | ^~~~~~
main.c: In function 'main':
main.c:86:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

int main (void)

{

char in[1001];

int out,i;

for(;;)

{

scanf("%s",in);

if(on[0]=='0')

{

return 0;

}

out=0;

for(i=0;in[i]!='\0';i++)

{

out+=in[i]-'0';

}

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

}

}

Compiler output:
main.c: In function 'main':
main.c:17:4: error: 'on' undeclared (first use in this function); did you mean 'in'?
   17 | if(on[0]=='0')
      |    ^~
      |    in
main.c:17:4: note: each undeclared identifier is reported only once for each function it appears in
Language: C

  


#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main(void){

char num_str[1002];

int num;

long sum=0;

int i;

int stdim=0+char tmp;

while(1)

{

fgets(num_str,sizeof(num_str),stdin);

if(num_str,[0]=='0')break;

for(i=0;i<strlen(num_str)-1;i++)

{

tmp=num_str[i];

num=atoi(&tmp);

sum=sum+num;

}

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

sum=0;

memset(num_str,1001,0);

}

return 0;

}
 

Compiler output:
main.c: In function 'main':
main.c:20:13: error: expected expression before 'char'
   20 | int stdim=0+char tmp;
      |             ^~~~
main.c:28:12: error: expected expression before '[' token
   28 | if(num_str,[0]=='0')break;
      |            ^
main.c:34:1: error: 'tmp' undeclared (first use in this function)
   34 | tmp=num_str[i];
      | ^~~
main.c:34:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#include<string.h>


int main(void){


int num,i,c,sum;


char n[1001];


char s;


while(1){


scanf("%s",n);


i=0;


sum=0;


str=&n;


c=(int)strlen(str);


if(n[0]=='0'){


if(c==1){


break;


}


}


while(i<c){


num=n[i]-'0';


sum=sum+n;


i++;


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


}


return 0;


}

Compiler output:
main.c: In function 'main':
main.c:30:1: error: 'str' undeclared (first use in this function)
   30 | str=&n;
      | ^~~
main.c:30:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:57:4: error: assignment to 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   57 | sum=sum+n;
      |    ^
main.c:72:1: error: expected declaration or statement at end of input
   72 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
char num_str[1002];
int num;
long sum=0;
int i;
char tmp;
while(1){
fgets(num_str,sizeof(num_str),stdin);
if(num_str[0]=='0')
break;
for(i=0;i<strlen(num_str)-1;i++){
tmp=num_str[i];
num=atoi(&tmp);
sum+=num;
}
printf("%ld\n",sum);
sap=0;
mem set(num_str,1002,0);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:1: error: 'sap' undeclared (first use in this function)
   20 | sap=0;
      | ^~~
main.c:20:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:1: error: unknown type name 'mem'
   21 | mem set(num_str,1002,0);
      | ^~~
main.c:21:17: error: expected ')' before numeric constant
   21 | mem set(num_str,1002,0);
      |                 ^~~~
      |                 )