Language: Java

#include <stdio.h>
#include <stdlib.h>
int main(){
  int *A;
  int k=0,i=0,j=0,v=0,a,c=0,size;

  scanf("%d",&size);//size of array
  A = (int *)malloc(size * sizeof(int)); // memory

  for(c=0;c<size;c++){
  scanf("%d",&a);
    A[c]=a;
    }

  for(k=0;k<c;k++){
    printf("%d " ,A[k]);
  }
  printf("\n");
  

  for(i=1;i<=c-1;i++){
    v = A[i];
    j = i - 1;
    while(j>=0 && A[j] > v){
      A[j+1] = A[j];
      j--;
      A[j+1] = v;
    }
  for(k=0;k<c-1;k++){
    printf("%d ",A[k]);
  }
  printf("%d",A[k]);
  printf("\n");
  }
  free(A);
  return 0;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
  int k=0,i=0,j=0,v=0,a,c=0,size;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
  scanf("%d",&size);//size of array
  ^
Main.java:8: error: class, interface, enum, or record expected
  A = (int *)malloc(size * sizeof(int)); // memory
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(c=0;c<size;c++){
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(c=0;c<size;c++){
          ^
Main.java:10: error: class, interface, enum, or record expected
  for(c=0;c<size;c++){
                 ^
Main.java:12: error: class, interface, enum, or record expected
    A[c]=a;
    ^
Main.java:13: error: class, interface, enum, or record expected
    }
    ^
Main.java:15: error: class, interface, enum, or record expected
  for(k=0;k<c;k++){
          ^
Main.java:15: error: class, interface, enum, or record expected
  for(k=0;k<c;k++){
              ^
Main.java:17: error: class, interface, enum, or record expected
  }
  ^
Main.java:21: error: class, interface, enum, or record expected
  for(i=1;i<=c-1;i++){
  ^
Main.java:21: error: class, interface, enum, or record expected
  for(i=1;i<=c-1;i++){
          ^
Main.java:21: error: class, interface, enum, or record expected
  for(i=1;i<=c-1;i++){
                 ^
Main.java:23: error: class, interface, enum, or record expected
    j = i - 1;
    ^
Main.java:24: error: class, interface, enum, or record expected
    while(j>=0 && A[j] > v){
    ^
Main.java:26: error: class, interface, enum, or record expected
      j--;
      ^
Main.java:27: error: class, interface, enum, or record expected
      A[j+1] = v;
      ^
Main.java:28: error: class, interface, enum, or record expected
    }
    ^
Main.java:29: error: class, interface, enum, or record expected
  for(k=0;k<c-1;k++){
          ^
Main.java:29: error: class, interface, enum, or record expected
  for(k=0;k<c-1;k++){
                ^
Main.java:31: error: class, interface, enum, or record expected
  }
  ^
Main.java:33: error: class, interface, enum, or record expected
  printf("\n");
  ^
Main.java:34: error: class, interface, enum, or record expected
  }
  ^
Main.java:36: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:37: error: class, interface, enum, or record expected
}
^
29 errors