/in/foo.c: In function 'fun':
/in/foo.c:6:20: error: 'x' undeclared (first use in this function)
for(i=1;i<=x;i++)
^
/in/foo.c:6:20: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:8:16: error: 'n' undeclared (first use in this function)
if(n%i==0)
^
/in/foo.c:13:12: warning: 'return' with a value, in function returning void
return sum;
^~~
/in/foo.c:2:6: note: declared here
void fun()
^~~
/in/foo.c: In function 'main':
/in/foo.c:20:13: error: 'n' undeclared (first use in this function)
sum=fun(n);
^