Language: C

#include<stdio.h>
#define MAX 100005
#define NIL -1

struct Node{ int p,l,r,R,L;};
struct Node T[MAX]; 

void print(int u){
  
  int i = T[u].p, depth = 0, height, j = T[u].R, sibling = NIL, degree = 0;

  while(i!=NIL){
    i = T[i].p;
    depth++;
  }

  height = Height(u,0);  


  if(T[u].L == NIL && T[u].r != NIL){
    sibling = T[u].r;
  }else if(T[u].L != NIL && T[u].r == NIL){
    sibling = T[u].L;
  }

  if(T[u].l == NIL && T[u].R == NIL){
    degree = 0;
  }else if(T[u].l==NIL || T[u].R==NIL){
    degree = 1;
  }else if(T[u].l!=NIL && T[u].R!=NIL){
    degree = 2;
  }

  if(depth==0){
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, root\n",u,T[u].p,sibling,degree,depth,height);
  }else if(T[u].l == NIL && T[u].R == NIL){
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, leaf\n", u, T[u].p, sibling, degree, depth, height);
  }else{
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, internal node\n",u,T[u].p,sibling,degree,depth,height);
  }
}

int Height(int a, int count){
  
  int x,y;

  x=y=count;
  if(T[a].l!=NIL){
    x = Height(T[a].l, count+1);
  }

  if(T[a].R!=NIL){
    y = Height(T[a].R, count+1);
  }
 
  if(x < y ){
    x = y;
  }

  return x;  
} 

main(){
  int i,j,d,v,c,l,n;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    T[i].p = T[i].l = T[i].r = T[i].L = T[i].R = NIL;
  }

  for(i=0;i<n;i++){
    scanf("%d %d %d",&v,&d,&c);

      T[v].l = d;
      T[c].L = d;
      T[v].R = c;
      T[d].r = c;
      T[d].p = v;
      T[c].p = v;
    
    }

  for(i=0;i<n;i++){
    print(i);
  }

  return 0;
}
#include<stdio.h>
#define MAX 100005
#define NIL -1

struct Node{ int p,l,r,R,L;};
struct Node T[MAX]; 

void print(int u){
  
  int i = T[u].p, depth = 0, height, j = T[u].R, sibling = NIL, degree = 0;

  while(i!=NIL){
    i = T[i].p;
    depth++;
  }

  height = Height(u,0);  


  if(T[u].L == NIL && T[u].r != NIL){
    sibling = T[u].r;
  }else if(T[u].L != NIL && T[u].r == NIL){
    sibling = T[u].L;
  }

  if(T[u].l == NIL && T[u].R == NIL){
    degree = 0;
  }else if(T[u].l==NIL || T[u].R==NIL){
    degree = 1;
  }else if(T[u].l!=NIL && T[u].R!=NIL){
    degree = 2;
  }

  if(depth==0){
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, root\n",u,T[u].p,sibling,degree,depth,height);
  }else if(T[u].l == NIL && T[u].R == NIL){
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, leaf\n", u, T[u].p, sibling, degree, depth, height);
  }else{
    printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, internal node\n",u,T[u].p,sibling,degree,depth,height);
  }
}

int Height(int a, int count){
  
  int x,y;

  x=y=count;
  if(T[a].l!=NIL){
    x = Height(T[a].l, count+1);
  }

  if(T[a].R!=NIL){
    y = Height(T[a].R, count+1);
  }
 
  if(x < y ){
    x = y;
  }

  return x;  
} 

main(){
  int i,j,d,v,c,l,n;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    T[i].p = T[i].l = T[i].r = T[i].L = T[i].R = NIL;
  }

  for(i=0;i<n;i++){
    scanf("%d %d %d",&v,&d,&c);

      T[v].l = d;
      T[c].L = d;
      T[v].R = c;
      T[d].r = c;
      T[d].p = v;
      T[c].p = v;
    
    }

  for(i=0;i<n;i++){
    print(i);
  }

  return 0;
}

Compiler output:
main.c: In function 'print':
main.c:17:12: error: implicit declaration of function 'Height' [-Wimplicit-function-declaration]
   17 |   height = Height(u,0);
      |            ^~~~~~
main.c: At top level:
main.c:63:1: error: return type defaults to 'int' [-Wimplicit-int]
   63 | main(){
      | ^~~~
main.c:94:8: error: redefinition of 'struct Node'
   94 | struct Node{ int p,l,r,R,L;};
      |        ^~~~
main.c:5:8: note: originally defined here
    5 | struct Node{ int p,l,r,R,L;};
      |        ^~~~
main.c:95:13: error: conflicting types for 'T'; have 'struct Node[100005]'
   95 | struct Node T[MAX];
      |             ^
main.c:6:13: note: previous declaration of 'T' with type 'struct Node[100005]'
    6 | struct Node T[MAX];
      |             ^
main.c:97:6: error: redefinition of 'print'
   97 | void print(int u){
      |      ^~~~~
main.c:8:6: note: previous definition of 'print' with type 'void(int)'
    8 | void print(int u){
      |      ^~~~~
main.c:132:5: error: redefinition of 'Height'
  132 | int Height(int a, int count){
      |     ^~~~~~
main.c:43:5: note: previous definition of 'Height' with type 'int(int,  int)'
   43 | int Height(int a, int count){
      |     ^~~~~~
main.c:152:1: error: return type defaults to 'int' [-Wimplicit-int]
  152 | main(){
      | ^~~~
main.c:152:1: error: redefinition of 'main'
main.c:63:1: note: previous definition of 'main' with type 'int()'
   63 | main(){
      | ^~~~