Not able to write modified print function

I,m not able to print the output, can you help me with this.

This is my code.

#include
using namespace std;

class node
{
public:
int data;
node *right;
node *left;
node(int d)
{
data=d;
right=left=NULL;
}
};

node *createtreefromtrav(int *in,int *pre,int s,int e)
{
static int i=0;

if (s>e)
{
    return NULL;
}

node *root=new node(pre[i]);

int index=-1;
for (int j=s;j<=e;j++)
{
    if (in[j]==pre[i])
    {
        index=j;
        break;
    }
}

i++;

root->left=createtreefromtrav(in,pre,s,index-1);
root->right=createtreefromtrav(in,pre,index+1,e);

return root;

}

void printinorder(node*root)
{
if (root==NULL)
{
cout<<β€œEND”;
return;
}
printinorder(root->left);
cout<data<<"=>";
printinorder(root->right);
cout<<endl;
}

int main()
{
int n;
cin>>n;
int pre[n];
for (int i=0;i<n;i++)
{
cin>>pre[i];
}
int m;
cin>>m;
int in[m];
for (int i=0;i<m;i++)
{
cin>>in[i];
}

node *root=createtreefromtrav(in,pre,0,n-1);

printinorder(root);

return 0;

}

hello @Krishna-Kumar-1362299170640596

please refer this code snippet