C program for palindrome, C/C++ Programming

C Program for Palindrome

void main()

{

          char ch[30];

          char ch1[30];

          int i,j,l;

          clrscr();

          printf("ENTER THE STRING: ");

          gets(ch);

          l=strlen(ch);

          j=0;

          for(i=l-1;i>=0;i--,j++)

                   ch1[j]=ch[i];

                   ch1[j]='\0';

                   if(strcmp(ch,ch1)==0)

                             printf("IT IS A PALINDROME");

                   else

                             printf("IT IS NOT A PALINDROME");

          getch();

}

 


 

OUTPUT :

 

ENTER THE STRING: MALAYALAM

 IT IS A PALINDROME


 

 

 

 


 

 

Posted Date: 9/10/2012 2:52:25 AM | Location : United States







Related Discussions:- C program for palindrome, Assignment Help, Ask Question on C program for palindrome, Get Answer, Expert's Help, C program for palindrome Discussions

Write discussion on C program for palindrome
Your posts are moderated
Related Questions
Explain the  bit fields portable or not? - No, Bit fields aren't portable. - As Bit fields can't span machine words and number of bits in a machine word is different on diff

Talking to IO boards inside a computer or microcontroller depends upon the principles used by the microprocessor to address physical devices. On Motorola systems all devices connec

In this problem, you will write a program that implements two algorithms for performing exact inference given a Bayesian network, namely, enumeration and variable elimination. Your

Write a simple telephone book program that stores the names and phone numbers of your friends/acquaintances in a file. Your program should have the abilities to: a. Add entries (na

Hi I''m trying to connect to CISCO router using termios. So I decided to have two threads one for reading data and the other one for writing data. The problem is that I have to add

#quesdifferentiate betweenrelocatable and self relocating program with exampletion..

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Want an EA project for Jack Bsher Project Description: New EA game Skills required   Android, C++ Programming, PHP, Metatrader, SQL

C Program to copy the contents of a file: void main()    {   ifstream fin("input.txt");   ofstream fout("output.txt");   char ch;   while (fin)       {

write a C program for padovan string for a natural number