Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

why is it showing segmentation fault at the end of the compilation?

0 votes
asked Jun 24, 2019 by GOPALGANGULY (120 points)

2 Answers

+1 vote
answered Jun 24, 2019 by anonymous
because you are trying to access the memory which you have not allocated

ex. your array size is 10 (a[10]) and you are trying to access the memory at 11th index (a[11])
0 votes
answered Aug 20, 2019 by SWEngineer (300 points)
What you have in your code is called "infinite recursion". It results in a Stack Overflow rather quickly.

See this corrected code: https://onlinegdb.com/SJh5u8KNS
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...