Reverse the array data structure by R4R Team


Array is the collection of different values having same data type.
-We have a integer Array that having all integer values.
-Character array is known as String.

Reverse of array:
Integer Array is {1,2,3,4,5}
Reverse Array is {5,4,3,2,1}


#include < stdio.h>
int main()
int a[5],b[5];
int i;
printf("Enter 5 number in array\n");
//input in array
for(i=0;i< 5;i++){
//Now reverse and copy in another array
for(i=0;i< 5;i++)
printf("Reverse array is\n");
for(i=0;i< 5;i++)


Enter 5 number in array
1 2 3 4 5
Reverse array is
5 4 3 2 1

-In this program, we take a input of 5 numbers in first Array.
-then run the loop and traverse the first array from the last and store in second array from the start.
-We can traverse first array from the end by a[5-i-1].
-then we print the second array which is the required answer.

Leave a Comment:
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!