Write a Java program that has the user rough n. You may call the

icon
Related questions
Question
requirement- The code expected to be relatively short, up to 10 lines
Write a Java program that has the user enter an integer n. The program then outputs to the numbers 1
rough n. You may call the method "keyboard.nextInt()" which returns the integer entered by the user on the
eyboard. Here are two sampleruns (these are samples do not use the numbers 7 or 16 in your program)
Sample Run #1:
Enter an integer: 7
Here are the integers up to 7: 1 2 3 4 5 6 7
Sample Run #2:
Enter an integer: 16
Here are the integers up to 16: 1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16
Transcribed Image Text:Write a Java program that has the user enter an integer n. The program then outputs to the numbers 1 rough n. You may call the method "keyboard.nextInt()" which returns the integer entered by the user on the eyboard. Here are two sampleruns (these are samples do not use the numbers 7 or 16 in your program) Sample Run #1: Enter an integer: 7 Here are the integers up to 7: 1 2 3 4 5 6 7 Sample Run #2: Enter an integer: 16 Here are the integers up to 16: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer