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]=='f'){
      scanf("%d",&x);
      Node s=Search(root,x);
      if (s!= NIL ) printf("yes\n");
      else printf("no\n");
    }
    else if (str[0]=='p'){
      Inorder(root);
      printf("\n");
       
      Preorder(root);
      printf("\n");
    }
  }
  return 0;
}

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);
      }
  }
}
 
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);
}

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