swap.cpp: In function 'int main()':
swap.cpp:23:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(int i=1;i<=n;i++)printf("%i ",a[i]);printf("\n");
^~~
swap.cpp:23:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
for(int i=1;i<=n;i++)printf("%i ",a[i]);printf("\n");
^~~~~~
swap.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%i",&n);
~~~~~^~~~~~~~~
swap.cpp:11:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1;i<=n;i++)scanf("%i",&a[i]);
~~~~~^~~~~~~~~~~~