Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <stdlib.h>
- #include <time.h>
- #include <string.h>
- char invtab(char arr[])
- {
- int longueur = strlen(arr);
- char tmp;
- char tmp2;
- for(int i = 0 ; i < longueur ; i++)
- {
- tmp = arr[i];
- tmp2 = arr[ longueur - i - 1];
- arr[i]= tmp2;
- arr[ longueur - i - 1] = tmp;
- if(i == 2) printf("tab miparcourt %s\n",arr);
- // printf("arr[i] %c\n",arr[i]);
- // printf("tmp %c\n",tmp);
- // printf("tmp2 %c\n",tmp2);
- // printf("arr[ longueur - i - 1]; %c\n",arr[ longueur - i - 1]);
- }
- }
- int main()
- {
- char arr[]="maman";
- //char arr2[] ="salut";
- invtab(arr);
- printf("Avec tableau : %s\n",arr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement