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]
2 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]2 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
Why did scientists who study weather need more advanced technology? Check all that apply.
kobusy [5.1K]

Answer:

All options are correct.

Explanation:

All options apply to the question because they all need technology for development and improvement. Scientists needed to develop more technologies in order to attend all their necessities, such as anticipating weather changes, forecasting weather previously, predicting weather behaviour in different places and in one specific place, accounting for reasons and natural resources related to weather changes, and much more. Therefore, technology provides faster and more consistent data for all these informations needed, since all technology tools to study weather were developed according to their specific needs.

4 0
3 years ago
Read 2 more answers
Only numbers should go in the columns for Payload Size and Packet Size. The sizes are in bytes. Don't forget to account for the
Anna11 [10]

Answer:

Non-Payload Bytes sent are 1476(total) - 393 (payload) = 1083 bytes

1083 (non-payload) out of 1476(total) is 73.37 %

Non-Hello bytes sent are 1476(total) - 53(hello payload) = 1425 bytes

1425(non-hello) out of 1476(total) is 96.54 %

7 0
3 years ago
Google is an example of a(n):
Andre45 [30]
Well i see your X so i would say you were correct it is a search engine.
7 0
2 years ago
Read the following characteristic:
Ivanshal [37]

Answer:

A goal of procedural programming

An advantage of object oriented programming

A disadvantage of object oriented programming

A drawback of procedural programming

3 0
1 year ago
In a public switched telephone network, lines are terminated at the central office.
FrozenT [24]

Answer:

True.

Explanation:

A Central office or local office in Metropolitan cities is a building or an office where the phone lines coming from a home or office are terminated and connected to a bigger switching system.Central office got the switching equipment which holds the ability to switch calls long-distances or locally.Hence we conclude that the answer is True.

5 0
3 years ago
Other questions:
  • Cari brought 2 pounds of grapes at the grocery store she ate 5 ounces of the grapes on way home what is the weight of the grapes
    12·1 answer
  • most dialog boxes in windows programs requiring navigation follow a similar procedure. true or false.
    7·1 answer
  • If you find yourself boxed in by a vehicle on your left or right _____________
    14·2 answers
  • How do you interpret field in contest of a DBMS?
    5·1 answer
  • To construct a battery with a current of 6 A, you would connect six 1 A cells
    9·1 answer
  • What is a computer network that provides connectivity in a geographic area or region larger than that covered by a local area ne
    7·1 answer
  • CHALLENGE ACTIVITY 3.7.2: Type casting: Reading and adding values.
    10·1 answer
  • Clarice is an architect who is involved in design work on a restaurant in a building that used to be part of the city’s water wo
    8·1 answer
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • One last question
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!