0
Can you tell me how i create c++ program to read a sequence of nonnegative integers from the user ending with a negative integer
Problem in creating a code in c++
1 Réponse
+ 3
You could use a do-while loop and keep iterating 'till you find the negative number.
Like so: https://code.sololearn.com/cUmY7zJ7Vhgz
EDIT: If you need to store all the values you may want to look at dynamic arrays or std::vector.