my code is giving correct output on ideone but when submitting here it says Runtime error(SIGSEGV)…please can anyone help!
It is happening because you might be accessing some part of memory which is not available to you.
For example, you may be accessing some element of array which is actually not there.
Suppose you have declared an array a
and you are trying to access element a in your program.