C program for palindrome, C/C++ Programming

Assignment Help:

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


 

 

 

 


 

 


Related Discussions:- C program for palindrome

Day calculate b/w two dates, Write a function that calculates the number of...

Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year.

How to write Bernoulli''s principle, compose a C program to solve the equat...

compose a C program to solve the equation z2=(p1/Pg)+(v1^2/2g)+z1 p1=100kpa,v1=2m/s z1=3m P=1000kg/m^3 define g=9.81

Usb photobackup, Project Description: Prepare software that will work with ...

Project Description: Prepare software that will work with our USB hardware that easily lets you backup all the pictures in your computer into the USB stick in one single step. Once

Illustrate the example of constructor, A Constructive Example Consider ...

A Constructive Example Consider an example , to model a user-defined data type for  strings. The object simulates a character array ( string ) using a character pointer and an

Need an indicator, Need an indicator Project Description: Need an ind...

Need an indicator Project Description: Need an indicator which indicates target and trailing sl after entering trades. Skills required are C Programming, C++ Programming,

Explain the for loop - computer programming, Explain the For Loop - Compute...

Explain the For Loop - Computer Programming? Similar to the while statement, for loop is an entry controlled loop and the code of the for loop will be executed itereatively. Th

Decodethecode, 6999066263304447777077766622337778 -----> message sent by th...

6999066263304447777077766622337778 -----> message sent by the first smuggler. my name is robert---------> message decoded by the second smuggler. Where ‘0’ denotes the "space".

Padovan string, write a C program for padovan string for a natural number

write a C program for padovan string for a natural number

Simplify the logical phrase with C++, hi i want wite a C++ program that get...

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 Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd