CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
87
You visited us 87 times! Enjoying our articles? Unlock Full Access!
Question

Which keyword can be used for coming out of recursion?


A

Break

No worries! We‘ve got your back. Try BYJU‘S free classes today!
B

Return

Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C

Exit

No worries! We‘ve got your back. Try BYJU‘S free classes today!
D

Both break and return

No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B

Return


Answer: (2) Return

The return keyword is being used to stop a function from executing and to pass the programme control back to the calling function.

  • The break declaration was used to automatically terminate the programme loop when encountered.
  • The break keyword causes an instant exit for while or do from the switch or loop statements.
  • The keyword used is return for coming out of recursion.
  • The void exit () keyword immediately terminates the process or function.

Articles to Explore:

  1. How many buttons on the keyboard?
  2. Write a short note on the importance of the computer.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Sentence completion
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon