Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- char ch[50];
- char ch1[50];
- int test,i;
- do
- {
- printf ("Donner le premier mot\n");
- scanf ("%s",ch);
- printf ("Donner le deuxieme mot\n");
- scanf ("%s",ch1);
- test=strlen(ch)==strlen(ch1);
- }while (test!=1);
- i=0;
- do
- {
- test=ch[i]==ch1[(strlen(ch)-1)-i];
- i++;
- }while (test==1 && i<strlen(ch));
- if (test==1)
- {
- printf ("Les deux mots sont inverses");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment