Getting segmentation fault
There are issues in the approach. Also you are not handling the carry. Refer this and verify your approach once. https://www.geeksforgeeks.org/add-two-numbers-represented-by-two-arrays/
There are issues in the approach. Also you are not handling the carry. Refer this and verify your approach once. https://www.geeksforgeeks.org/add-two-numbers-represented-by-two-arrays/