foo.c: In function 'main':
foo.c:17:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(i=0; i<k; i++)
^~~
foo.c:19:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
for(i=0; i<n; i++) {
^~~
foo.c:11:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&n,&k);
^~~~~~~~~~~~~~~~~~~~
foo.c:13:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a[i]);
^~~~~~~~~~~~~~~~~