When it will return back to previous function

for a word arts , after display arts , it is not found set for s then , how it will return back??

@Vipin_coder,
Can you please mention the function names as well?

And after displaying arts, if there’s no word starting with s, it will simply return