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; }
2 Respostas
0
Still nothing for some reason the minAge is getting the biggest value
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 😸