Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created January 12, 2020 14:04
Show Gist options
  • Save uncoded-ro/bda4b19e0c69df868afc004e1a1f695f to your computer and use it in GitHub Desktop.
Save uncoded-ro/bda4b19e0c69df868afc004e1a1f695f to your computer and use it in GitHub Desktop.
class Iteratie {
public static void main(String[] args) {
int i;
// instructiunea while
i = 0;
while (i < 10) {
System.out.print(i + " ");
i++;
}
System.out.print("\n");
// instructiunea do-while
i = 0;
do {
System.out.print(i + " ");
i++;
} while (i < 10);
System.out.print("\n");
// instructiune for
for (i = 0; i < 10; i++)
System.out.print(i + " ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment