Copy one array into another in Reverse Order
This program demonstrates how to copy one array into another in reverse order.
//Copy one array into another in Reverse Order
//***********************
//www.botskool.com
//***********************
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n=10,a[20],b[20];
clrscr();
printf("How many element do you wish to enter in array? :"); scanf("%d",&n);
printf("\nEnter the Elements:\n");
for(i=0;i<n;i++)
{
printf("Enter Element No %d : ",1+i);
scanf("%d",&a[i]);
}
printf("\n Original ARRAY: \n");
for(i=0;i<n;i++)
printf(" %d ",a[i]);
for(i=0;i<n;i++)
{
b[n-1-i]=a[i];
}
printf("\n Copied ARRAY: \n");
for(i=0;i<n;i++)
printf(" %d ",b[i]);
getch();
}
//***********************
//www.botskool.com
//***********************
Output will look like this:




Recent comments
1 day 13 hours ago
1 day 13 hours ago
2 days 13 hours ago
1 week 1 day ago
1 week 1 day ago