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 c language in simple words?
Explain the bubble sort algorithm.
How are 16- and 32-bit numbers stored?
What is meant by initialization and how we initialize a variable?
Explain how are portions of a program disabled in demo versions?
Why is python slower than c?
Explain how do you print an address?
Are there namespaces in c?
How will you find a duplicate number in a array without negating the nos ?
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
What is an lvalue in c?
Compare array data type to pointer data type
What does the error message "DGROUP exceeds 64K" mean?
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.
What are run-time errors?