0

Hi everyone i been trying to do the ticket challenge perhaps my code is getting minimum age copying every element of the array

#include <iostream> using namespace std; int main() { int ages[5]; int minAge; // minAge = ages; for (int i = 0; i < 5; ++i) { cin >> ages[i]; // cout << ages[i] << endl ; } minAge = ages[0]; // cout << minAge <<endl ; for (int i = 0; i < 5 ; ++i) { if (minAge > ages[i] ); { minAge = ages[i]; // cout << ages[i] <<endl ; cout << minAge <<endl ; } } int valor; valor = 5 * 10 / minAge ; cout << valor ; return 0; }

1st Jun 2022, 3:53 PM
Player001100
Player001100 - avatar
6 Answers
0
Still nothing for some reason the minAge is getting the biggest value
1st Jun 2022, 4:06 PM
Player001100
Player001100 - avatar
0
Thank you so much, again me not paying attention to my code i was getting really mad but gotta pay more attention next time 😾
1st Jun 2022, 4:23 PM
Player001100
Player001100 - avatar