Language: C

  int key;
  struct node *parent;
  struct node *left;
  struct node *right;
} ;

typedef struct node Node;

Node *root, *NIL;

void Insert(int);
void Inorder(Node *);
void Preorder(Node *);

int main(){
  int n,i,a;
  char in[7],insert[7] = "insert";

  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%s",in);
    if(strcmp(in, insert) == 0){
      scanf("%d",&a);
      Insert(a);
    }
    else {
      Inorder(root);
      printf("\n");
      Preorder(root);
      printf("\n");
    }
  }
  return 0;
}

void Insert(int a){
  Node *b = NIL;
  Node *c = root;
  Node *d;

  d = malloc(sizeof(Node));
  d -> key = a;
  d -> left = NIL;
  d -> right = NIL;
  while(c != NIL){
    b = c;
    if(d -> key < c -> key) c = c -> left;
    else  c = c -> right;
  }

  d -> parent = b;
  if(b == NIL)  root = d;
  else {
    if(d -> key < b -> key)  b -> left = d;
    else    b -> right = d;
  }
}

void Inorder(Node *u){
  if(u == NIL) return;
  else{
    Inorder(u -> left);
    printf(" %d", u->key);
    Inorder(u -> right);
  }
}

void Preorder(Node *u){
  if(u == NIL) return;
  else{
    printf(" %d", u->key);
    Preorder(u -> left);
    Preorder(u -> right);
  }
}



Compiler output:
main.c:5:1: error: expected identifier or '(' before '}' token
    5 | } ;
      | ^
main.c: In function 'main':
main.c:19:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   19 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 |   int key;
main.c:19:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   19 |   scanf("%d",&n);
      |   ^~~~~
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:22:8: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   22 |     if(strcmp(in, insert) == 0){
      |        ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcmp'
  +++ |+#include <string.h>
    1 |   int key;
main.c:28:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   28 |       printf("\n");
      |       ^~~~~~
main.c:28:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:28:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'Insert':
main.c:41:7: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   41 |   d = malloc(sizeof(Node));
      |       ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
  +++ |+#include <stdlib.h>
    1 |   int key;
main.c:41:7: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   41 |   d = malloc(sizeof(Node));
      |       ^~~~~~
main.c:41:7: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:41:21: error: invalid application of 'sizeof' to incomplete type 'Node' {aka 'struct node'}
   41 |   d = malloc(sizeof(Node));
      |                     ^~~~
main.c:42:5: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   42 |   d -> key = a;
      |     ^~
main.c:43:5: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   43 |   d -> left = NIL;
      |     ^~
main.c:44:5: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   44 |   d -> right = NIL;
      |     ^~
main.c:47:10: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   47 |     if(d -> key < c -> key) c = c -> left;
      |          ^~
main.c:47:21: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   47 |     if(d -> key < c -> key) c = c -> left;
      |                     ^~
main.c:47:35: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   47 |     if(d -> key < c -> key) c = c -> left;
      |                                   ^~
main.c:48:17: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   48 |     else  c = c -> right;
      |                 ^~
main.c:51:5: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   51 |   d -> parent = b;
      |     ^~
main.c:54:10: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   54 |     if(d -> key < b -> key)  b -> left = d;
      |          ^~
main.c:54:21: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   54 |     if(d -> key < b -> key)  b -> left = d;
      |                     ^~
main.c:54:32: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   54 |     if(d -> key < b -> key)  b -> left = d;
      |                                ^~
main.c:55:15: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   55 |     else    b -> right = d;
      |               ^~
main.c: In function 'Inorder':
main.c:62:15: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   62 |     Inorder(u -> left);
      |               ^~
main.c:63:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   63 |     printf(" %d", u->key);
      |     ^~~~~~
main.c:63:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:63:20: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   63 |     printf(" %d", u->key);
      |                    ^~
main.c:64:15: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   64 |     Inorder(u -> right);
      |               ^~
main.c: In function 'Preorder':
main.c:71:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   71 |     printf(" %d", u->key);
      |     ^~~~~~
main.c:71:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:71:20: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   71 |     printf(" %d", u->key);
      |                    ^~
main.c:72:16: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   72 |     Preorder(u -> left);
      |                ^~
main.c:73:16: error: invalid use of incomplete typedef 'Node' {aka 'struct node'}
   73 |     Preorder(u -> right);
      |                ^~