1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Westkost [7]
3 years ago
10

Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin

g the number of integers that follow. For coding simplicity, follow each output integer by a space, including the last one. Assume that the list will always contain less than 20 integers.
Computers and Technology
1 answer:
kkurt [141]3 years ago
3 0

Answer:

The program to this question as follows:

Program:

#include <stdio.h> //header file.

int main() //main method.

{

const int size= 20; //define variable.

int a[size]; //define array

int i, n; //define variable

printf("Enter number of elements :"); //message.

scanf("%d", &n);//input size of array.

printf("Enter array elements :"); //message

for (i = 0; i < n; ++i) //loop

{

scanf("%d",&a[i]); //input array elements by user.

}

printf("Reverse order :\n");

for (i = 0; i < n; ++i) //loop

{

printf("%d ",a[n-i-1]); //print elements in reverse order.

}

return 0;

}

Output:

Enter number of elements :5

Enter array elements :5

4

3

2

1

Reverse order :

1 2 3 4 5  

Explanation:

The description of the above program as follows:

  • In the program firstly we include the header file and define a method that is "main method" in the method we define variables that are "size, n, i, and a[]".  The size variable is used to make a variable constant that means its value will not change in the program. We pass the size variable value to the array and use i variable for loop.
  • We use variable n and a[] for user inputs. In n variable, we input a number of elements to be inserted into an array and a[] we insert all array elements to insert these elements we use for loop.
  • Then we define another for loop in this loop we print all array elements in reverse order.
You might be interested in
A type of bridge that relies on a curved, semi-circular structure for support
inna [77]
Arch bridges have a semicirclar, curved support.
8 0
3 years ago
What kind of software would you recommend a company use if its employees are receiving e-mails that are potentially hazardous ?
scZoUnD [109]

Answer:

Microsoft project

Explanation:

I'm smart

6 0
3 years ago
Select the data type for each example below. <br> Possible answers<br> -Int<br> -float <br> -string
Shkiper50 [21]

Answer:

2.5 = float

'2.5' = str

3 = int

Explanation:

The data type: "float" is used for positive or negative decimals.

The data type: "str" is used for a sequence of letters, numbers, or symbols. Since the decimal used apostrophes, this means it's a character literal.

The data type: "int" is used for any positive or negative whole number.

7 0
2 years ago
Code in Python
KIM [24]

You're setting the value of user_num to 20. Doing this won't allow the other test cases to run. Simply delete that line and your code should work. This is the code I wrote:

user_num = int(input())

while user_num>=1:

   user_num/=2

   print(user_num)

I wrote my code in python 3.8. I hope this helps.

4 0
2 years ago
If I were to delete a file on a school Chromebook on Chrome OS, would teachers have some special way of seeing it?
Maslowich
Am not sure
Hope I helped
3 0
3 years ago
Other questions:
  • A manufacturer of machine tools creates a spreadsheet of tools and the cost for those. The spreadsheet has four fields: name of
    13·1 answer
  • Prewritten, commercially available sets of software programs that eliminate the need for a firm to write its own software progra
    5·1 answer
  • The practice of texting is most popular and what age group
    12·2 answers
  • What is the name of the file manager in Microsoft Windows. The file manager used in Microsoft Windows is?
    12·2 answers
  • Select the correct answer
    14·1 answer
  • Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input
    12·1 answer
  • Define Agricultural Era
    14·2 answers
  • An entrepreneur identifies and fills the gap between what the society needs and what is available is called​
    5·1 answer
  • This computer is used by touching your finger.
    14·1 answer
  • What is the minimum ethernet frame size that will not be discarded by the receiver as a runt frame?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!