/in/foo.c: In function 'main':
/in/foo.c:7:20: error: 'n' undeclared (first use in this function)
for(i=1;i<=n;i++)
^
/in/foo.c:7:20: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c: At top level:
/in/foo.c:17:6: warning: return type of 'main' is not 'int' [-Wmain]
void main()
^~~~
/in/foo.c:17:6: error: conflicting types for 'main'
/in/foo.c:2:5: note: previous definition of 'main' was here
int main()
^~~~
/in/foo.c: In function 'main':
/in/foo.c:21:9: warning: implicit declaration of function 'fun' [-Wimplicit-function-declaration]
sum=fun(n);
^~~