if i give input like
2
3
-5
then why its showing error???
as when -5 is processed till then cumulative sum becomes 0. after that it checks for next input but as there is no input so it gives “no such element” exception.
so how to check whether there is element present on console or not.