#include <stdio.h>
void inversesL(int L[],int t);
void inverseaL(int L[],int t);
int main() {
int tab[5]={2,1,6,4,9};
int i;
inverseaL(tab,5);
for (i=0;i<5;i++)
printf("%d ",tab[i]);
int tab2[5]={2,1,6,4,9};
inversesL(tab2,5);
printf("\n");
for (i=0;i<5;i++) {
printf("%d ",tab2[i]);
}
return 0;
}
void inversesL(int L[],int t) {
int temp,i;
for (i=0;i<((t/2)+(t%2));i++) {
temp=L[i];
L[i]=L[(t-i-1)];
L[(t-i-1)]=temp;
}
}
void inverseaL(int L[],int t) {
int Lfin[t];
int i;
for (i=0;i<t;i++)
Lfin[i]=L[(t-i-1)];
for (i=0;i<t;i++)
L[i]=Lfin[i];
}
To embed this project on your website, copy the following code and paste it into your website's HTML: