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
Put these operating systems in order according to the date they were released. (The first to be released would be
uysha [10]
1. ms-dos 1981
2. windows 2.0 1987
3. windows xp 2001
4. mac os 2001
5. windows 7 2009
8 0
3 years ago
A degree-constrained minimum spanning tree is a minimum spanning tree (MST) where the maximum vertex degree is limited to a cert
Bingel [31]

Answer:

A spanning tree is a subset of Graph G, which has all the vertices covered with minimum possible number of edges. Hence, a spanning tree does not have cycles and it cannot be disconnected..

By this definition, we can draw a conclusion that every connected and undirected Graph G has at least one spanning tree. A disconnected graph does not have any spanning tree, as it cannot be spanned to all its vertices.

Spanning Trees

We found three spanning trees off one complete graph. A complete undirected graph can have maximum nn-2 number of spanning trees, where n is the number of nodes. In the above addressed example, n is 3, hence 33−2 = 3 spanning trees are possible.

General Properties of Spanning Tree

We now understand that one graph can have more than one spanning tree. Following are a few properties of the spanning tree connected to graph G −

A connected graph G can have more than one spanning tree.

All possible spanning trees of graph G, have the same number of edges and vertices.

The spanning tree does not have any cycle (loops).

Removing one edge from the spanning tree will make the graph disconnected, i.e. the spanning tree is minimally connected.

Adding one edge to the spanning tree will create a circuit or loop, i.e. the spanning tree is maximally acyclic.

Explanation:

8 0
3 years ago
What layer is responsible for routing messages through an internetwork in the tcp/ip model?
Paul [167]

Answer:

<h2>The TCP/IP model consists of four layers: application, transport, internet, and network access. Of these four layers, it is the internet layer that is responsible for routing messages.</h2>
4 0
2 years ago
explain the impact of effectively understanding the various formatting options available in the word processing software applica
Vera_Pavlovna [14]

The formatting tool is very important. When one effectively understands the various formatting options available in the word processing software application, one can be able to;

  • Make more accessible options for readers through creating and use of headings, highlighting key words or ideas etc.

  • Formatting any document helps one to have a  presentable and professional document.

  • It makes the document easier and a lot interesting to read.

  • It helps in Proper punctuation marks and spelling usefulness.

<h3>What is formatting in MS Word?</h3>

Formatting text is simply known as the act of controlling how one wants a particular text to appears in your document. This includes the control of the size, color, etc.

Learn more about word processing software  from

brainly.com/question/1022352

8 0
2 years ago
If a song is public domain, that means:
DaniilM [7]

Answer: C

Explanation:

Public Domain mean public owns it and it don’t belong to an individual author or artist. Anyone can use a public domain without obtaining permission but can’t ever own it

4 0
3 years ago
Other questions:
  • Jim has entered the age of each of his classmates in cells A1 through A65 of a spreadsheet. Which function should Jim use to fin
    11·2 answers
  • must understand both art and engineering. a. industrial designer b. environmental designer c. interior designer d. graphic desig
    14·1 answer
  • Robert needs to apply formatting from one set of text to multiple other sets of text throughout the document. Which option shoul
    7·1 answer
  • What type of computer/device do you have i need it for a survey and it due today soooooooooooooo
    14·1 answer
  • What is the difference between a crosstab query and a subquery?
    11·2 answers
  • On the MarketingConsultants worksheet, in cells D10:H13, use a PMT function to calculate the end of the month payment amount. En
    15·1 answer
  • How can i setup a mesage room and also want to hangout ??????
    10·1 answer
  • When you create a new database using --------- , the database includes prebuilt tables and forms which you can populate with dat
    15·1 answer
  • write a program that computes an integer's checksum. to compute the checksum, break the integer into its constituent
    11·1 answer
  • How many residues separate amino acids that are stabilized by hydrogen bonds in α helices?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!