Doubt in code of simple input

i am not getting how i should print the no before the sum gets negative I mean what to write in if condition

Just keep printing the numbers until the sum gets negative just as you take the input/

i still dont get it how should i do it

https://ide.codingblocks.com/s/205966 plz edit the code and mention error

@uks.2610 here i have updated your code (https://ide.codingblocks.com/s/206083)