Create tree using inorder and preorder

my code is not giving any output for creation of tree using preorder and inorder . can you plzz tell why??
link:https://ide.codingblocks.com/s/112382

hey @khushi91200, in line no 23, update the loop condition with s<=e instead of j<=e.

when i did for(int j=s;s<=e;j++) it is still giving error

hey @khushi91200, share me the updated code saved in Coding Blocks ide.

https://ide.codingblocks.com/s/113030 here is the link

hey @khushi91200, you tree is built correctly, it is giving error because of print function. Here is logic of print function. Change your code according to that
void print(node* root)
{
if(root==NULL)
{
return;
}
if(root->left!=NULL&&root->right!=NULL)
{
cout<left->data<<" => β€œ<data<<” <= "<right->data<<endl;
}
else if(root->left==NULL&&root->right!=NULL)
{
cout<<β€œEND => β€œ<data<<” <= β€œ<right->data<<endl;
}
else if(root->left!=NULL&&root->right==NULL)
{
cout<left->data<<” => β€œ<data<<” <= END”<<endl;
}
else
{
cout<<β€œEND => β€œ<data<<” <= END”<<endl;
}
print(root->left);
print(root->right);
}