Question d’entretien chez Oracle

see above

Réponse à la question d'entretien

Utilisateur anonyme

7 mai 2015

Question: If I gave you 0-100 inputs, print X if even, Y if div by 5, the number if anything else. Answer (there is probably a more elegant way to do this): int main() { int upperBound = 101; for(int i = 0; i < upperBound; ++i) { if(i % 2 == 0) { if(i % 5 == 0) { cout << "Y "; } else { cout << "X "; } } else { cout << i << " "; } } return 0; }