fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char arr[] ="vivek";
  5. int i,l,count=0;
  6. l= strlen(arr);
  7. for(i=0;i<l;i++){
  8. if(arr[i] == arr[l-1-i]){
  9. count++;
  10. }
  11. }
  12. if(i== count){
  13. printf("Palindrome");
  14. }else{
  15. printf("Not palindrome");
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 4388KB
stdin
Standard input is empty
stdout
Not palindrome