#include <stdio.h>
//copy of arrays in reverse order
int main()
{
int arr1[5],arr2[5],i,j;
printf("\n Enter 5 array Elements :");
for(i=0;i<=4;i++)
scanf("%d",&arr1[i]);
for(i=0,j=4;i<=4;i++,j--)
{
arr2[j]=arr1[i]; //values interchanged
}
printf("After interchanging :\n");
for(i=0;i<=4;i++)
{
printf("%d\n",arr2[i]);
}
return 0;
}
Comments
Post a Comment