public class VoyelleEtConsonne { public static void main(String[] args) { for(int i = 0; i < 100; i++) { char c = (char)(Math.random() * 26 + 'a'); System.out.print(c + ": "); switch(c) { case 'a': case 'e': case 'i': case 'o': case 'u': System.out.println("voyelle"); break; case 'y': case 'w': System.out.println("Utilis� souvent comme voyelle"); break; default: System.out.println("consonne"); } } } } |
Cet article Comment utliser l’instruction ‘switch’: Exemple de voyelle et consonne est apparu en premier sur .