Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Programming: Define an integer array with an array element number of 20, plus
Programming: Define an integer array with an array element number of 20, plus

#include

int main()

{int n,i,j,t,a[20];

printf("The number of data to be entered (<=20)=?");

scanf("%d",&n);

for(i =0;i

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

for(i=0,j=n-1;i< j;i++,j--)

{t=a[i];a[i]=a[j];a[j]=t;}

printf( "Array after inversion:\n");

for(i=0;i

printf("%d ",a[i]) ;

printf("\n");

return 0;

}