My code is giving segmentation fault
see this is the updated code:
if you have any doubt you can ask here:
Happy Learning!!
okay but why my code was not running ?
because you were not taking data type as of type long long int.
this was the error.
and also in main you were declaring large arrays.
Happy Learning!!
So what is the difference between declaring a large array as globally or locally ?
when you declare the large arrays locally then it is declared in the stack and it can give error like stack overflow.
whereas when we declare it globally then it is declared inside the computers memory then it doesnt give run error.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.