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
What is operator precedence?
How do you sort filenames in a directory?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
What's a good way to check for "close enough" floating-point equality?
What does printf does?
How do I round numbers?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
Why functions are used in c?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
Is it fine to write void main () or main () in c?
In c language can we compile a program without main() function?
What are the application of void data type in c?
What is the difference between void main and main in c?
Differentiate between full, complete & perfect binary trees.
What does double pointer mean in c?