Ticket office C++
You are working on a ticketing system. A ticket costs $10. The office is running a discount campaign: each group of 5 people is getting a discount, which is determined by the age of the youngest person in the group. You need to create a program that takes the ages of all 5 people as input and outputs the total price of the tickets. Sample Input: 55 28 15 38 63 Sample Output: 42.5 MY CODE: #include <iostream> using namespace std; int main() { int ages[5]; for(int i=0; i<5; i++){ cin >> ages[i]; } int temp = ages[5]; for(int i=0; i<5; i++) { if(temp>ages[i]){ temp = ages[i]; } } float d = 50*(temp/100.00); float total = 50-d; cout << "
quot; << total; } Whats problem. Output comes $50. but when i run it on PC it runs.