could you pls tell me why is it not working exactly
My code not working
1. First of all it is showing you the segmentation fault, because of the mistake in for loop at line no:37, at some point you are trying to access the element which is not present at the index you specified. As you have started with i=0, and decrementing i’s value, your code tries to print a[0],a[-1],a[-2] so on, which is incorrect.
It actually has to be for(int i=n-1;i>=0;i--)
2 you have written multiply function and the logic that you have written is correct, but you missed to return the value of n. change the return type to int and add a line to return n.
check this