Doubt in the function part

what if we remove the int in the function and replace it with void , further simply calling the function at line no. 10. it does not work can u tell why

If u want to use void then if u find the key then print the key there only and use exit() to end program.