How to return a value from a void function and use it inside the void loop?

Thank you for your comments. I will come back to you guys here, once I understand.