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
i want to know the procedure of qualcomm for getting a job through offcampus
Is it possible to initialize a variable at the time it was declared?
What is pointer to pointer in c?
What is wrong with this code?
What is const keyword in c?
What are the uses of null pointers?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Explain what is dynamic data structure?
What are inbuilt functions in c?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Why we not create function inside function.
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Can we add pointers together?
Explain which function in c can be used to append a string to another string?
What would be an example of a structure analogous to structure c?