write a program to display the array elements in reverse
order in c language

Answer Posted / siraj-ud-doulla

#include<stdio.h>

int main()
{
int n,i;
printf("How many number you get \n:");
scanf("%d",&n);
int arr[n];
printf("You need %d numbers\n",n);
for(i=0;i<n;i++){
scanf("%d",&arr[i]);
}
printf("Revarse number is:\n");
for(i=n-1;i>=0;i--){
printf("%d\n",arr[i]);
}
return 0;

}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c language in simple words?

598


Explain the bubble sort algorithm.

649


How are 16- and 32-bit numbers stored?

726


What is meant by initialization and how we initialize a variable?

590


Explain how are portions of a program disabled in demo versions?

657






Why is python slower than c?

609


Explain how do you print an address?

661


Are there namespaces in c?

570


How will you find a duplicate number in a array without negating the nos ?

1650


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

907


What is an lvalue in c?

698


Compare array data type to pointer data type

603


What does the error message "DGROUP exceeds 64K" mean?

729


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1214


What are run-time errors?

602