/in/foo.c: In function 'main':
/in/foo.c:7:23: error: 'num' undeclared (first use in this function); did you mean 'sum'?
7 | for(int sum=2;num<=n;num++)
| ^~~
| sum
/in/foo.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:13:17: error: expected expression before '}' token
13 | }
| ^
/in/foo.c:14:25: error: 'i' undeclared (first use in this function)
14 | sum+=i;
| ^
/in/foo.c:9:21: warning: variable 'sum' set but not used [-Wunused-but-set-variable]
9 | int sum=1;
| ^~~
/in/foo.c:7:17: warning: unused variable 'sum' [-Wunused-variable]
7 | for(int sum=2;num<=n;num++)
| ^~~
/in/foo.c: At top level:
/in/foo.c:20:10: error: expected identifier or '(' before 'if'
20 | if(sum==num){
| ^~
/in/foo.c:23:7: error: expected identifier or '(' before '}' token
23 | }
| ^
/in/foo.c:24:7: error: expected identifier or '(' before 'return'
24 | return 0;
| ^~~~~~
/in/foo.c:25:1: error: expected identifier or '(' before '}' token
25 | }
| ^