- 1
C++ x *= 0.array[ y] why not working?
3 Answers
0
Nick Gamer
Incomplete code..
Provide full code.
0
int ages[5];
for (int i = 0; i < 5; ++i) {
cin >> ages[i];
}
//your code goes here
double nums = 50;
for(int b = 0; b<5;b++){
nums -= 0.ages[b];
}
cout << nums;
0
Nick Gamer
0.ages[b] is not a right syntax
You have to get minimum value from that array ages. To get minimum value you can store first value in a variable and then compare this value with next value of that array.
And after getting minimum value calculated discounted amount like
50 - 50 * minimum_age / 100;