+ 2

What's my discount?

Why is my output and expected output the same, but it is still saying I am wrong? #include <iostream> using namespace std; int main() { double items[] = {500, 12.4, 94, 45, 3, 81, 1000.9, 85, 90, 1, 35}; int x; int p; cin >> p; for (int x = 0; x < 10; x++) { cout << items[x] - items[x] * p / 100<<" "; } //your code goes here return 0; }

12th Feb 2022, 8:05 PM
bazeley
3 Respostas
+ 3
Thanks for your reply, but i workied out that I needed to put x <<11 as the second argument in my for loop. Oops 😬
12th Feb 2022, 8:30 PM
bazeley
+ 2
👍 edit: x<11, ( '<<' is left shift operator )
12th Feb 2022, 8:32 PM
Jayakrishna 🇮🇳
+ 1
What is your expected output? And your? What is actual question? Add description details... x declared twice. you can remove one.
12th Feb 2022, 8:24 PM
Jayakrishna 🇮🇳