Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created October 24, 2022 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/fd2d62a6991b7cfffa19da08ee560388 to your computer and use it in GitHub Desktop.
Save parzibyte/fd2d62a6991b7cfffa19da08ee560388 to your computer and use it in GitHub Desktop.
public static void serieNumerica() {
Scanner sc = new Scanner(System.in);
System.out.println("Número: ");
int numero = sc.nextInt();
sc.close();
for (int i = 1; i <= numero; i++) {
System.out.printf("%d,", i);
}
}
public static void main(String[] args) {
serieNumerica();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment