/in/foo.c: In function 'main':
/in/foo.c:7:9: error: 'k1' undeclared (first use in this function)
int a1=k1,a2=k2;
^~
/in/foo.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:7:15: error: 'k2' undeclared (first use in this function)
int a1=k1,a2=k2;
^~
/in/foo.c:18:9: warning: too many arguments for format [-Wformat-extra-args]
printf("%d%d\n",a1,n,sum+2);
^~~~~~~~
/in/foo.c:6:12: warning: unused variable 'flag' [-Wunused-variable]
int sum=0,flag=0;
^~~~