Algo++ : print bst keys in the given range

I am getting Wrong answer on submitting my code . please help code link : https://ide.codingblocks.com/s/106196

@amandahiya.3572
Modify to print function and make it like this
void print(node* root,int k1,int k2)
{
if(root==NULL)// || root->data<k1 || root->data>k2)
return;

print(root->left,k1,k2);
if(root->data >= k1 && root->data <= k2){
    cout<<root->data<<" ";
}
//cout<<root->data<<" ";
print(root->right,k1,k2);
return;

}

This is because there could be a node having value greater than k2 , but its left children might be suitable candidate for getting printing as left child is less than the node .
Simlarly there could be nodes having value < k1 , but there right children could be suitable for printing.
Your code simply returns from there only missing out on several suitable candidates that could be printed.
So only check for printing when you hit the cout statement .