Advertisement
mdgaziur001

For Kafi

Apr 3rd, 2020
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char main[1000],rev[1000];
  6.     int freq=0;
  7.     scanf("%[^\n]",main);
  8.     int i,j;
  9.     int len=strlen(main)-1;
  10.     for(i=len,j=0;i>=0;i--,j++)
  11.     {
  12.         rev[j]=main[i];
  13.     }
  14.     for(i=0;i<len;i++)
  15.     {
  16.         if(rev[i]==main[i]){
  17.             freq++;
  18.         }
  19.     }
  20.     if(freq==len){
  21.         printf("Yes\n");
  22.     }
  23.     else{
  24.         printf("No\n");
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement