185k views
1 vote
Create a Raptor program that allows a user to enter 10 numbers into an array and then display the number in the reverse order of entry. For example: if the user enters 5243., the display should show 3425. Create an array and enter the user's input. Then display the numbers in the array in the order of last in, first displayed. Be sure to add prompts and labels to your input and display.

User MotKohn
by
8.0k points

1 Answer

4 votes

Below is an example of a simple program that fulfills your requirements.

Program ReverseArray;

Declare numbers[10]: Integer; // Declare an array to store 10 numbers

Declare i, userInput: Integer;

// Input loop to get 10 numbers from the user

For i = 1 To 10 Do

Display "Enter number ", i, ": ";

Input userInput;

numbers[i] := userInput;

End For

// Display the numbers in reverse order

Display "Numbers in reverse order:";

For i = 10 To 1 Step -1 Do

Display numbers[i];

End For

End Program

Create a Raptor program that allows a user to enter 10 numbers into an array and then-example-1
User DwB
by
7.8k points