+ 1

Where is my mistake?

int main() { double items[] = {500, 12.4, 94, 45, 3, 81, 1000.9, 85, 90, 1, 35}; //your code goes her double discounted = 0; double present_off; cin >> present_off; for(int x; x < 12; x++){ discounted += items[x]-(items[x]*present_off)/100; } cout << discounted << " ";

29th Dec 2021, 10:01 AM
Hamed Wahabzada
Hamed Wahabzada - avatar
3 Answers
+ 3
I hope this helps you if there is a problem tell us and what is supposed to be input/output. https://code.sololearn.com/c00lJ5BQVA0i/#cpp
29th Dec 2021, 2:10 PM
SoloProg
SoloProg - avatar
+ 2
Use this instead: for(int x=0; x < 11; x++){
29th Dec 2021, 10:18 AM
SoloProg
SoloProg - avatar
+ 2
And?
29th Dec 2021, 10:55 AM
Hamed Wahabzada
Hamed Wahabzada - avatar