Advertisement
TawratNibir

Untitled

Dec 31st, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int siz(char s[]) {
  4.     int size=0;
  5.     for(int i=0;s[i]!='\0';i++) {
  6.         size++;
  7.     }
  8.     return size;
  9. }
  10. int main() {
  11.     char a[] = "tnelis";
  12.     char b[] = "silent";
  13.     int size_a = siz(a);
  14.     int size_b = siz(b);
  15.     if(size_a!=size_b) {
  16.         printf("TRUE");
  17.     }
  18.     else{
  19.         int ans = 0;
  20.         for(int i=0;i<size_a;i++) {
  21.             if(a[i]!=b[size_b-i-1]) {
  22.                 ans = 1;
  23.                 break;
  24.             }
  25.         }
  26.         if(ans) printf("TRUE");
  27.         else printf("FALSE");
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement