+ 1

I need to know how do I know how much numbers can the user put in this code

#include <iostream> using namespace std; int main() { int purchaseAmount = 0; int totalPrice; //the code goes here int i; //I tried to do this but it's not working!!!! do{ cin >> totalPrice; i%=totalPrice; cout << totalPrice*15/100; }while( i=0); return 0; }

10th Aug 2021, 7:04 AM
Anoir B'f
Anoir B'f - avatar
4 Respuestas
+ 1
Anoir B'f you can analize this code to see how to handle SL tasks: https://code.sololearn.com/ciOxxnbG6ILF/?ref=app
10th Aug 2021, 9:40 PM
JaScript
JaScript - avatar
+ 3
First of all while(i=0) will not work. It should be at least while(i==0) but for right answer will be needed information what want you with this code do? Anoir B'f with above mentioned code can be only one number received.
10th Aug 2021, 7:14 AM
JaScript
JaScript - avatar
+ 1
JaScript I need from that code to execute 3 received numbers but I don't know how
10th Aug 2021, 5:21 PM
Anoir B'f
Anoir B'f - avatar
+ 1
OMG thank you so much mate.JaScript
10th Aug 2021, 11:05 PM
Anoir B'f
Anoir B'f - avatar