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
hi i want wite a C++ program that get one logical phrase (included {x,y,z,w,1,0}) and simplify it! but i ''m confused! thanxs for anubody help me...

Write a program that takes the image tracks.jpg and finds Canny edges, and then finds lines in these edges using the Hough transform. The easiest way to do this is to take the prog

6#666#665533999 where # is used as space.output is monkey

how to avoid duplicates strings in an array

can you tell me what is c#

I. COURSE DESCRIPTION Develops a working knowledge of object-oriented concepts in areas of classes, inheritance, data structures, error handling, templates and file processing.

Why PHP is also known as scripting language? PHP is fundamentally a general purpose language, which is used to write scripts. Scripts are normal computer files which comprises

Please give me a programming code of first & follow with c or c++ laqnguage .When anyone give me the programming code of first & follow please explain every lines with the help

Write in a file: void main() { int i,j,k,l,list[1000]; FILE *fp; char any[8];   cout cin >> any;   fp = fopen(any,"wb");     for(j=0;j     {

Ask question #write statement that assign random integer to the varaible n in the (100