write a program to display the array elements in reverse
order in c language
Answer Posted / prajot chougale
#include<stdio.h>
main()
{
int n, c, d, a[100], b[100];
printf("Enter the number of elements in array\n");
scanf("%d",&n);
printf("Enter the array elements\n");
for ( c = 0 ; c < n ; c++ )
scanf("%d",&a[c]);
for ( c = n - 1, d = 0 ; c >= 0 ; c--, d++ )
b[d] = a[c];
for ( c = 0 ; c < n ; c++ )
a[c] = b[c];
printf("Reverse array is\n");
for( c = 0 ; c < n ; c++ )
printf("%d\n", a[c]);
return 0;
}
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
How many bytes are occupied by near, far and huge pointers (dos)?
in iso what are the common technological language?
What is the scope of global variable in c?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
Is it possible to initialize a variable at the time it was declared?
Write a program to implement queue.
What is the meaning of && in c?
What is the full form of getch?
What is volatile keyword in c?
Tell me when would you use a pointer to a function?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
Can one function call another?
What will the preprocessor do for a program?
swap 2 numbers without using third variable?
What is methods in c?