Language: C

#include<stdio.h>
#include<stdlib.h>

#define NIL NULL
 
struct node{
  struct node *l;
  struct node *r;
  struct node *p;
  int key;
};
 
typedef struct node * Node;
 
Node root;

main(){
  int n, i, x;
  char str[20];
   
  scanf("%d",&n);
 
  for ( i = 0; i < n; i++ ){
    scanf("%s",str);
 
    if (str[0]=='i'){
      scanf("%d",&x);
      insert(x);
    } 
    else if (str[0]=='p'){
      Inorder(root);
      printf("\n");
       
      Preorder(root);
      printf("\n");
    }
    else if(str[0]=='f'){
      scanf("%d",&x);
      Node s=Search(root,x);
      if (s!= NIL ) printf("yes\n");
      else printf("no\n");
    }
  }
  return 0;
}
void insert(int k){
  Node y=NIL;
  Node x=root;
  Node z;
 
  z = malloc(sizeof(struct node));
  z->key=k;
  z->l=NIL;
  z->r=NIL;
   
  while(x!=NIL){
    y=x;
 
    if(z->key<x->key) x=x->l;
    else x=x->r;
  }
  z->p=y;
   
  if(y==NIL) root=z;
  else if(z->key<y->key) y->l=z;
  else y->r=z;
}
 
Node Search(Node t,int k){
  if(t==NIL || k==t->key) return t;
  if(k<t->key) return Search(t->l,k);
  else return Search(t->r,k);
}

void Preorder(Node t){
  printf(" %d",t->key);
  if(t!=NIL){
    if(t->l!=NIL)Preorder(t->l);
    if(t->r!=NIL)Preorder(t->r);
  }
}
 
void Inorder(Node t){
   
  if(t!=NIL){
    if(t->l!=NIL){
      Inorder(t->l);
      }
    printf(" %d",t->key);
     
    if(t->r!=NIL){
      Inorder(t->r);
      }
  }
}

Compiler output:
main.c:17:1: error: return type defaults to 'int' [-Wimplicit-int]
   17 | main(){
      | ^~~~
main.c: In function 'main':
main.c:28:7: error: implicit declaration of function 'insert' [-Wimplicit-function-declaration]
   28 |       insert(x);
      |       ^~~~~~
main.c:31:7: error: implicit declaration of function 'Inorder' [-Wimplicit-function-declaration]
   31 |       Inorder(root);
      |       ^~~~~~~
main.c:34:7: error: implicit declaration of function 'Preorder' [-Wimplicit-function-declaration]
   34 |       Preorder(root);
      |       ^~~~~~~~
main.c:39:14: error: implicit declaration of function 'Search'; did you mean 'bsearch'? [-Wimplicit-function-declaration]
   39 |       Node s=Search(root,x);
      |              ^~~~~~
      |              bsearch
main.c:39:14: error: initialization of 'Node' {aka 'struct node *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
main.c: At top level:
main.c:46:6: warning: conflicting types for 'insert'; have 'void(int)'
   46 | void insert(int k){
      |      ^~~~~~
main.c:28:7: note: previous implicit declaration of 'insert' with type 'void(int)'
   28 |       insert(x);
      |       ^~~~~~
main.c:69:6: error: conflicting types for 'Search'; have 'struct node *(struct node *, int)'
   69 | Node Search(Node t,int k){
      |      ^~~~~~
main.c:39:14: note: previous implicit declaration of 'Search' with type 'int()'
   39 |       Node s=Search(root,x);
      |              ^~~~~~
main.c:75:6: warning: conflicting types for 'Preorder'; have 'void(struct node *)'
   75 | void Preorder(Node t){
      |      ^~~~~~~~
main.c:34:7: note: previous implicit declaration of 'Preorder' with type 'void(struct node *)'
   34 |       Preorder(root);
      |       ^~~~~~~~
main.c:83:6: warning: conflicting types for 'Inorder'; have 'void(struct node *)'
   83 | void Inorder(Node t){
      |      ^~~~~~~
main.c:31:7: note: previous implicit declaration of 'Inorder' with type 'void(struct node *)'
   31 |       Inorder(root);
      |       ^~~~~~~