0

here it goes..
example prog. output:

Input a number/s, (-) to stop:
5+6-7+8-9+1-2-1


-the user will input numbers, if he/she inputs a (-) number that will be the time that the program will stop.
-the operations between the numbers should be + and - (alternate).

how will i do the codes in C++?
*urgent:D

4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by pradhan.nc
0

You dont seem to show us any effort. But maybe I can give you a clue. Read in numbers and if the number is less than 0 then quit..

0

here it goes..
example prog. output:

Input a number/s, (-) to stop:
5+6-7+8-9+1-2-1


-the user will input numbers, if he/she inputs a (-) number that will be the time that the program will stop.
-the operations between the numbers should be + and - (alternate).

how will i do the codes in C++?
*urgent:D

Hi!
Is this your homework? If so do it yourself.

Any way you may use a while loop and check condition for -ve number. The loop breaks when -ve no. is entered.
If you post your code it will be better for us to help you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.