Replace with sum of greater nodes


Please help me

@Gade_Deepthi
Your logic is correct. Just there is slight mistake in your code

  1. return type of modifysum() should be void. So change line no 29 to void modifysum(node *root,int *sum)
  2. Change line 33 to return;
    Your code will work fine for all cases.