Language: C

#include <stdio.h>

void insertionsort(int,int);

int main(void){

  int A[100];
  int n,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
   scanf("%d",&A[i]);
  }
  insertionsort(A,n);

  return 0;
}

void insertionsort(int A[],int n){

  int i,j,k,key;
  for(j=1;j<=n;j++){   
     key = A[j];       
     i = j-1;
     while(i>0 && A[i]>key){
          A[i+1]=A[i];  
          i = i-1;
        }
      A[i+1] = key;
      for(k=1;k<=n;k++){
      if(k == n)printf("%d\n",A[k]);
      else printf("%d ",A[k]);
      }
    }
}




Compiler output:
main.c: In function 'main':
main.c:13:17: error: passing argument 1 of 'insertionsort' makes integer from pointer without a cast [-Wint-conversion]
   13 |   insertionsort(A,n);
      |                 ^
      |                 |
      |                 int *
main.c:3:20: note: expected 'int' but argument is of type 'int *'
    3 | void insertionsort(int,int);
      |                    ^~~
main.c: At top level:
main.c:18:6: error: conflicting types for 'insertionsort'; have 'void(int *, int)'
   18 | void insertionsort(int A[],int n){
      |      ^~~~~~~~~~~~~
main.c:3:6: note: previous declaration of 'insertionsort' with type 'void(int,  int)'
    3 | void insertionsort(int,int);
      |      ^~~~~~~~~~~~~
main.c: In function 'insertionsort':
main.c:21:21: error: stray '\302' in program
   21 |   for(j=1;j<=n;j++){<U+00A0><U+00A0>
      |                     ^~~~~~~~
main.c:21:22: error: stray '\302' in program
   21 |   for(j=1;j<=n;j++){<U+00A0><U+00A0>
      |                             ^~~~~~~~
main.c:22:1: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      | ^~~~~~~~
main.c:22:2: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |         ^~~~~~~~
main.c:22:3: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                 ^~~~~~~~
main.c:22:4: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                         ^~~~~~~~
main.c:22:17: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                                             ^~~~~~~~
main.c:22:18: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                                                     ^~~~~~~~
main.c:22:19: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                                                             ^~~~~~~~
main.c:22:20: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                                                                     ^~~~~~~~
main.c:22:21: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                                                                             ^~~~~~~~
main.c:22:22: error: stray '\302' in program
   22 | <U+00A0><U+00A0><U+00A0><U+00A0> key = A[j];<U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>
      |                                                                                     ^~~~~~~~
main.c:23:1: error: stray '\302' in program
   23 | <U+00A0><U+00A0><U+00A0><U+00A0> i = j-1;
      | ^~~~~~~~
main.c:23:2: error: stray '\302' in program
   23 | <U+00A0><U+00A0><U+00A0><U+00A0> i = j-1;
      |         ^~~~~~~~
main.c:23:3: error: stray '\302' in program
   23 | <U+00A0><U+00A0><U+00A0><U+00A0> i = j-1;
      |                 ^~~~~~~~
main.c:23:4: error: stray '\302' in program
   23 | <U+00A0><U+00A0><U+00A0><U+00A0> i = j-1;
      |                         ^~~~~~~~
main.c:24:1: error: stray '\302' in program
   24 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>while(i>0 && A[i]>key){
      | ^~~~~~~~
main.c:24:2: error: stray '\302' in program
   24 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>while(i>0 && A[i]>key){
      |         ^~~~~~~~
main.c:24:3: error: stray '\302' in program
   24 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>while(i>0 && A[i]>key){
      |                 ^~~~~~~~
main.c:24:4: error: stray '\302' in program
   24 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>while(i>0 && A[i]>key){
      |                         ^~~~~~~~
main.c:24:5: error: stray '\302' in program
   24 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>while(i>0 && A[i]>key){
      |                                 ^~~~~~~~
main.c:25:1: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      | ^~~~~~~~
main.c:25:2: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |         ^~~~~~~~
main.c:25:3: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                 ^~~~~~~~
main.c:25:4: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                         ^~~~~~~~
main.c:25:5: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                                 ^~~~~~~~
main.c:25:6: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                                         ^~~~~~~~
main.c:25:7: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                                                 ^~~~~~~~
main.c:25:8: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                                                         ^~~~~~~~
main.c:25:9: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                                                                 ^~~~~~~~
main.c:25:10: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                                                                         ^~~~~~~~
main.c:25:23: error: stray '\302' in program
   25 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1]=A[i];<U+00A0>
      |                                                                                             ^~~~~~~~
main.c:26:1: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      | ^~~~~~~~
main.c:26:2: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |         ^~~~~~~~
main.c:26:3: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                 ^~~~~~~~
main.c:26:4: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                         ^~~~~~~~
main.c:26:5: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                                 ^~~~~~~~
main.c:26:6: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                                         ^~~~~~~~
main.c:26:7: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                                                 ^~~~~~~~
main.c:26:8: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                                                         ^~~~~~~~
main.c:26:9: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                                                                 ^~~~~~~~
main.c:26:10: error: stray '\302' in program
   26 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>i = i-1;
      |                                                                         ^~~~~~~~
main.c:27:1: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      | ^~~~~~~~
main.c:27:2: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      |         ^~~~~~~~
main.c:27:3: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      |                 ^~~~~~~~
main.c:27:4: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      |                         ^~~~~~~~
main.c:27:5: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      |                                 ^~~~~~~~
main.c:27:6: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      |                                         ^~~~~~~~
main.c:27:7: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      |                                                 ^~~~~~~~
main.c:27:8: error: stray '\302' in program
   27 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>}
      |                                                         ^~~~~~~~
main.c:28:1: error: stray '\302' in program
   28 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1] = key;
      | ^~~~~~~~
main.c:28:2: error: stray '\302' in program
   28 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00A0><U+00A0>A[i+1] = key;
      |         ^~~~~~~~
main.c:28:3: error: stray '\302' in program
   28 | <U+00A0><U+00A0><U+00A0><U+00A0><U+00