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

i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

634


Explain how do you determine the length of a string value that was stored in a variable?

661


What is the 'named constructor idiom'?

629


Which driver is a pure java driver

982


which is an algorithm for sorting in a growing Lexicographic order

1384






Why & is used in c?

699


What are loops in c?

542


what is bit rate & baud rate? plz give wave forms

1508


What is difference between stdio h and conio h?

874


Tell me when is a void pointer used?

640


What is the difference between printf and scanf in c?

737


What is an auto variable in c?

741


What are the features of c language?

611


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

4483


What does main () mean in c?

605