i solved it but the problem is that the first element of new array is always 0
Code:
#include<stdio.h>
main( )
{
int i,n,j ;
float arr[5], arr_new[5] ;
int temp;
for (i=0 ; i<5 ; ++i)
{
printf ("Enter the %dth element of array :", i) ;
scanf ( "%f", &arr[i] ) ;
}
for (i=0 ; i<5 ; ++i)
{
printf ("the value of element #%d is %f \n", i,arr[i]) ;
}
for( i = 0, j = 5; i<5; i++,j--)
{
temp = arr[i];
arr[i] = arr_new[j];
arr_new[j] = temp;
}
for (i=0 ; i<5 ; ++i)
{
printf ("the new array value of element #%d is %f \n", i,arr_new[i]) ;
}
}