Program to reverse the array.
#include <stdio.h>
void main()
{
int n, c, a[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]);
pdrintf("Reversed array is \n");
for(c=n;c>=0;c--)
printf("%5d",a[c]);
getch();
}
Output:
Comments
Post a Comment