Created
          April 25, 2012 16:07 
        
      - 
      
- 
        Save yesidays/2490964 to your computer and use it in GitHub Desktop. 
    #C Palindromo
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include<stdio.h> | |
| #include<conio.h> | |
| void main() | |
| { | |
| clrscr(); | |
| int i=0,lc=0,ban=0,d=0; | |
| char cad[50]; | |
| printf("Introduce el texto: ");gets(cad); | |
| while(cad[lc]) | |
| { | |
| lc++; | |
| } | |
| d=lc/2; | |
| lc--; | |
| for(i=0;i<d;i++) | |
| { | |
| if(cad[i]==32) | |
| i++; | |
| if(cad[lc]==32) | |
| lc--; | |
| if(cad[i]!=cad[lc]) | |
| { | |
| ban=1;break; | |
| } | |
| lc--; | |
| } | |
| if(ban==0) | |
| printf("Es una palabra palindromo"); | |
| else | |
| printf("No es una palabra palndromo"); | |
| getch(); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
En español es palíndromo, con O.