Respuesta :
Answer:
The program to this question can be described as follows:
Program:
#include<stdio.h> //defining header file
int main() //defining main method
{
const int total_number= 20; //defining integer constant variable
int a[total_number],i; //defining integer array and variable
printf("Enter total number, that you want to insert in list: "); //message
scanf("%d",&a[0]); //input value by user
printf("Input list: "); //message
for(i=1;i<=a[0];i++) // loop for input value
{
scanf("%d",&a[i]); //input value by user
}
printf("List in reverse order:\n");
for(i=a[0];i>0;i--) //loop for print list in reverse order
{
printf("%d ",a[i]); //print value
}
return 0;
}
Output:
Enter total number, that you want to insert in list: 5
Input list: 6
4
2
8
1
List in reverse order:
1 8 2 4 6
Explanation:
In the above C language program, three integer variable "total_number, a[], and i " is declared, in which total_number is a constant variable, that holds value 20, which is passed in an array, in array first element we input the total number of the list.
- In the next step, an array variable is used, that uses for loop to input number in list.
- Then another for loop is declared that prints the array value in its reverse order, with a white space.