How can we take multiple number of integer inputs by user choice in c in runtime. Here the first line of the input is the number of test cases. Then I am calculating the sum of the input numbers in this case.
The test case :
Input
3
1 6 7
2 7 3 4
2 1
Output:
14
16
3
Can we modify scanf() in this way so it can process this dynamic inputs.
I can't take the line as a string input and then split them into numbers.
Can we use the space and \n both to decide the numbers as we do to take strings as input as an example: scanf("%[^\n]",&str);