+ 1

Cin

cout << "Please input the number of items bought"; cin >> quantity; cout << "please input the price"; cin >> itemPrice; Why does the output discountinue after I input the number of item bought? :(

5th Mar 2017, 12:48 AM
Luke Mai
Luke Mai - avatar
1 Answer
+ 9
If you're running this on the Code Playground, you have to give all inputs at once when you compile your code. Ex, for this code, you'd input like this: 5 3.75 The program will take one line each time it reaches a cin.
5th Mar 2017, 1:01 AM
Tamra
Tamra - avatar