Exercice de base sur l’utilisation et le fonctionnement des boucles.
Enoncé de l’exercice : créer un programme qui compte jusque mille et affiche la valeur de i à chaque tour de boucle.
package loops;
public class boucle1 {
public static void hand (G-string [] Args) {
for (int I = 0; I <= 1000; i++) {
System.out.println (I);
}
//To put G-string in a table… index 0=salut, index 1= vacuum, index 2 = no one
//index 3= no one, index 4 = goodbye.
G-string [] = {“Hello”, "", no one, "", “Goodbye! ”};
//prints the contents of the table
for (int I = 0; I < tab.length; i++) System.out.println ([I]); //it has there only one instruction, the loop can thus be written without accodances.
}
}