#include<stdio.h>
int main()
{
int a[100], n, i;
printf("Enter number of elements, you want to insert in an array\n");
scanf("%d",&n);
printf("Enter array elements\n");
for(i = 0; i < n; i++)
scanf("%d",&a[i]);
printf("Array in Reverse Order is:\n");
for(i = n-1; i >= 0; i--)
printf("%d ",a[i]);
return 0;
}
INPUT:
Enter number of elements, you want to insert in an array
5
Enter array elements
11
22
33
44
55
OUTPUT:
Array in Reverse Order is:
55 44 33 22 11
int main()
{
int a[100], n, i;
printf("Enter number of elements, you want to insert in an array\n");
scanf("%d",&n);
printf("Enter array elements\n");
for(i = 0; i < n; i++)
scanf("%d",&a[i]);
printf("Array in Reverse Order is:\n");
for(i = n-1; i >= 0; i--)
printf("%d ",a[i]);
return 0;
}
INPUT:
Enter number of elements, you want to insert in an array
5
Enter array elements
11
22
33
44
55
OUTPUT:
Array in Reverse Order is:
55 44 33 22 11
No comments:
Post a Comment