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
what are objects or simply define objects

n this problem u given a board in which some of the elements are placed as shown in diagram below .each element represent a color .fill the other elements in the board such that no

Write a program which incorporates a function named compute and which is used to calculate the area and circumference of a circle. Use the main function for inputs and outputs.

Problem #1: plugging the memory leak. When you employ the "normal" new operator, for example Foo* p = new Foo(), the compiler generates some special code to manage the case while t

Is there any difference between List x; and List x ()? Can you please provide me assignment help.

In the Byteland country a string "s" is said to super ascii string if and only if count of each charecter in the string is equal to its ascci value in the byteland country ascii co

A: BinarySearchTree.h ---------------------- #ifndef BINARY_SEARCH_TREE_H_ #define BINARY_SEARCH_TREE_H_ #include "dsexceptions.h" #include // For NULL // Binary

Create a Document that show information about albums. First create a paragraph or two about the purpose of the page and your interests in music: genres, styles, etc. Next have a

Reference Oddities A reference variable can demote to any integer variable, be it in an array or a member variable from structure or class. Reference variables can demote to co

The zipped folder int_collection.zip (downloaded from Blackboard) contains an abstract class AbstractIntCollection and two interfaces: IntList and IntStack. The abstract class cont