i am getting runtime error
where have i gone wrong?
https://ide.codingblocks.com/s/51429
#simple input problem
You are restricting the numbers with array of 10 size only that means you can have 10 numbers only.
Hey, there is no need to take an array as there can be many inputs until value of sum becomes -ve, so simply take the input and add it to sum till the sum becomes -ve. You are getting run time error because you are taking the array of size 10 and there can be many inputs
but if i dont use afrray how will i keep the previous numbers for display can u pls correct the code
print the number after sum=sum + input_number ;
statement.
but then it will be like one input then output then again another input then output
what if we want to display all the final numbers together
and not one by one ?
No, there are two different files one for input and output. you can try your code on https://ide.codingblocks.com/ you will get this point, input and output will be displayed in different sub-windows.