Preview:
void insertionsort(int A[], int size){
  int i, j;
  for(i=1; i<size; i++){
    key= A[i];
    j=i-1;
    
    while(j>=0 && A[j]> key){
      A[j+1]= A[j];
      j=j-1;
    }
    A[j+1]= key;
  }
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter