using out parameter
There are multiple ways to do it.1) by using struct/Class as return type 2) by passing parameters by ref
You can use out and ref for your requirement.