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
Anettt [7]
3 years ago
15

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
Computers and Technology
1 answer:
lyudmila [28]3 years ago
7 0

Answer:

Following is the program in C language :

#include <stdio.h> // header file

#define n 5 //  macro

int main() main function

{

   int a[n],k1; // variable and array declaration

   printf("Enter the element:\n");

   for(k1=0;k1<n;++k1) //iterating the loop

   {

       scanf("%d",&a[k1]);//Read the values by user

   }

   printf("Output in Reverse Order:\n");

   for(k1=n-1;k1>=0;--k1)//iterating the loop

   {

   printf(" %d ",a[k1]); //Display the values

   }

   return 0;

}

Output:

Enter the element:

4

3

45

67

89

Output in Reverse Order: 89 67 45 3 4

Explanation:

Following is the description of the program

  • Define a macro "n" with value 5 after the header file.
  • Declared an array "a" and defined the size of that array by macro i.e "n".
  • Read the value by the user by using scanf statement in the array "a"
  • Finally In the last for loop display the values of array "a" by space.

You might be interested in
All of the following are ways to save money on transportation except :
Lisa [10]
The options listed are not related to the question. and if they were related in any sense then I would say the cheapest thing on the list is a phone card so I guess you can buy that and save the most for your travel as you can use phone cards anywhere as they have 1800 numbers which are free from any public phone. 
7 0
3 years ago
If not cleared out, log files can eventually consume a large amount of data, sometimes filling a drive to its capacity. If the l
OLEGan [10]

Answer:

<u>/var</u>

Explanation:

The /var subdirectory contains files to which the system writes data during the course of its operation. Hence, since it serves as a system directory, it would prevent log files from consuming a large amount of data.

7 0
2 years ago
Read 2 more answers
There is a simple method for constructing a magic square for any odd value of n:
DaniilM [7]

Answer:

See Explaination

Explanation:

class MagicSquare():

def __init__(self,side):

self.side=side

self.two_dimension=[]

for row in range(1,side+1):

row_line=[]

for col in range(1,side+1):

row_line.append(0)

self.two_dimension.append(row_line)

def display(self):

row=0

col=int((self.side-1)/2)

for i in range(1,self.side**2+1):

self.two_dimension[row][col]=i

row-=1

col+=1

if row==-1:

row=self.side-1

if col==self.side:

col=0

if self.two_dimension[row][col]==0:

continue

else:

row+=1

if row==self.side:

row==0

for line in self.two_dimension:

for num in line:

print("{0:>3}".format(num),end=" ")

print()

def main():

for i in range(1,14,2):

square=MagicSquare(i)

square.display()

print("----------------------------------------------------")

if __name__ == '__main__':

main()

3 0
3 years ago
10) What is the BEST way to rewrite sentence (1) to make it more
givi [52]
I believe the answer is D. It makes more sense and is the most correct grammatically.

Hope this helped and pls mark as brainliest!

~ Luna
3 0
3 years ago
Read 2 more answers
In a stack data structure, the following items are inserted in the following order: Bob, Alice, Charlie, Eve, Zebra. Then an ite
const2013 [10]

Answer:

Zebra.

Explanation:

Stack is LIFO, so Zebra is added in the last so it will be removed first.

6 0
2 years ago
Other questions:
  • All of the following except one are issues that should be covered in an AUP. Which one is the exception?
    5·1 answer
  • If you are viewing a webpage with customized or regenerated content, such as updated stock quotes, what type of webpage are you
    14·1 answer
  • What is Groovefunnels?
    10·2 answers
  • Robert is leading a project online that includes students from different cultures. Two of the students spend most of the time li
    7·1 answer
  • You don't have policies that force settings for the look of users' computer desktops. Each user's chosen desktop settings are ap
    15·2 answers
  • Discuss how the accessibility of television has changed over time
    7·1 answer
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    12·1 answer
  • Select the correct answer.
    10·1 answer
  • Please I need help.
    12·1 answer
  • The objective of this task is to use Scapy to estimate the distance, in terms of number of routers, between your VM and a select
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!