Reverse array

Write a program to copy the contents of one array into another in the reverse order.

#include


#include

void main(void)

{



int arr[10],i,*fp;

for(i=0;i<10;i++)

{

printf("Enter the %d element:",i+1);

scanf("%d",&arr[i]);

}

fp=&arr[9];

for(i=0;i<10;i++)

{

printf("%d",*fp--);

}

getch();

}

Comments

Popular posts from this blog

Tip of the Day # 13

Governor Generals of Pakistan