elocgamer507 elocgamer507
  • 13-09-2022
  • Computers and Technology
contestada

print 3 numbers before asking a user to input an integer

print 3 numbers before asking a user to input an integer class=

Respuesta :

ishwarya ishwarya
  • 13-09-2022

Answer:

you can use an array to do this

Explanation:

(I've written this in java - I think it should work out):

Scanner input = new Scanner(System.in);

System.out.println("Enter an integer: ");

int userInt = input.nextInt();

int[] array = new int[userInt - 1];

for(int i = userInt-1; i < userInt; i--)

     System.out.println(array[i]);

Answer Link

Otras preguntas

why is inaccurate to say CO is 50 percent oxygen
ANSWER THIS QUESTION FOR 10 POINTS! (image) A.) 45 B.) 60 C.) 90 D.) 135
Calculate the simple interest earned on an investment of 37,000 at 8% p.a. Over 4 years
bet diet for type 2 diabetes
Find the area of a sector with a central angle of 40 degrees and a diameter of 12 cm.
Carla bought a digital camera that cost $91.98. She also bought 2 identical memory cards and a camera case. The camera cost 6 times as much as the case. She pai
What is the slope of each line?
Read this quote from a campaign speech by Eugene Debs. “I am not a labor leader. I don't want you to follow me or anyone else. If you are looking for a Moses to
What are the Autotrophs in an Owl Food Web?
How is the structure of the governor's press release organized? A. sequence B. enumeration C. cause/effect D. compare/contrast