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
The part of the computer that contains the brain or central processing unit is also known as
Yuri [45]
Central processing unit (CPU)
4 0
3 years ago
Read 2 more answers
What responds to both visual appeal and functional needs? (1 point) A.) applied art B.) performance art C.) fine art D.) visual
d1i1m1o1n [39]

Answer:

a

Explanation:

6 0
3 years ago
Is co2+4h2--&gt; ch4 + 2h2o a combustion​
Nadya [2.5K]

Answer:

No its not a combustion its a formation.

Explanation:

7 0
3 years ago
Inheritance enables an object, called a _____, to derive one or more of its attributes from a parent.
jarptica [38.1K]

Answer:

The answer is C.) child

I hope this helps! ^-^

6 0
2 years ago
Which of the following activities would contribute the most to global warming?
stich3 [128]
Snowmobiling around a National park
5 0
3 years ago
Read 2 more answers
Other questions:
  • This career involves answering questions about computer parts and trouble shooting broken computers? Video game designer, comput
    10·1 answer
  • The key invention that enabled computers to go into every home and office is
    8·1 answer
  • Differences between the first four generations of computers​
    12·1 answer
  • What are two reasons people work?
    7·2 answers
  • )In a vector implementation of a stack ADT, you add an entry to the top of a stack using which vector method?
    13·1 answer
  • Why are user manuals important? Select all that apply.
    6·1 answer
  • Which of these is a way of making applications less vulnerable to hacking?
    7·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    14·2 answers
  • Guys please tell me which cable is this?
    12·2 answers
  • HC - AL-Career Preparedness
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!