I have input of the following format:
1 2 1 5 6
1 4 1 4
3 4
For each line, I need to print the sum of all integers in that line. I am thinking of taking input as a string, splitting it by space character and then converting it to its respective integral value. Is there a simpler way to read integer input in array till newline using scanf?