Midpoint runner technique

in this question why are we not using void and not using functions and are making pointer?
and why are we using cout instead of print?

@Aditiverma hey aditi bhaiya is using node* function because this function was returning mid point node that node was dereference in main function and then printing the data inside that node that why we are here using cout