Try the following code (and a more modern compiler)
#include<stdlib.h>
#include<stdio.h>
typedef struct tag_bstnode
{
int data;
struct tag_bstnode* right;
struct tag_bstnode* left;
} bstnode;
bstnode* getnewnode(int data){
bstnode* newnode=(bstnode*)malloc(sizeof(bstnode));
newnode->data=data;
newnode->right=NULL;
newnode->left=NULL;
return newnode;
}
bstnode* insert(bstnode* root,int data){
if(root==NULL) {
root=getnewnode(data);
}
else if(data<=root->data){
root->left=insert(root->left,data);
}else{
root->right=insert(root->right,data);
}
return root;
}
int search(bstnode* root,int data){
if(root==NULL) return(-1);
else if(root->data ==data) return(1);
else if(data <= root->data) return search(root->left,data);
else return search(root->right,data);
}
int main(){
bstnode* root=NULL;
root=insert(root,15);root=insert(root,10);root=insert(root,20);
root=insert(root,25);root=insert(root,8);root=insert(root,12);
int number;
printf("\n enter no. to be searched \n ");
scanf("%d",&number);
if(search(root,number)==1) printf("found \n ");
else printf("not found \n");
getchar();
return 0;
}