Printing -1 for NULL values

while printing the values of child nodes which are not present (i.e NULL) in the print function,

we do
if( root==NULL)
return;

and the output comes as -1 for the NULL nodes.

How does the compiler print -1 when we just have return as an exit condition and no court ?

No
If You just returned then it will not print -1 there may something else
you can send your code I will check

Share the link of your code

I got it now, became a bit confused initially.
Thanks.