Check whether the string entered is a palindrome or not, C/C++ Programming

Assignment Help:

Program is to check whether the string entered is a palindrome or not:

Program is to check whether the string entered is a palindrome or not invoke function from main

int palindrome(char *st);

 

void main()

 {

 clrscr();

 int x;

 char *st;

 int ans;

 cout<<" enter the string ";

 cin>>st;

 ans=palindrome(st);

 if (ans==0)

    cout<<" the string is palindrome ";

 else

  cout<<" the string is not a palindrome ";

 }

 

 int palindrome(char *st)

  {

  int i;

  int l=strlen(st);

  for(i=0;i

    {

    if (st[i]!=st[l-1-i])

                return 1;

    }

    return 0;

  }

 

 


Related Discussions:- Check whether the string entered is a palindrome or not

Template class and class template in c++, Differentiate between a template ...

Differentiate between a template class and class template in C++? Ans) Template class: A generic definition or a parameterized class not instantiated until the client gives the

Function, write a function named "fact"that takes one integer arguments,ca...

write a function named "fact"that takes one integer arguments,call them "num" and returns as ..............

Explain multiple inheritance with a common base, Multiple inheritance with ...

Multiple inheritance with a common base (Hybrid Inheritance) Inheritance is an important and powerful feature of OOP. Only the imagination of the person concerned is the limit.

Parking garage, A parking garage charges a $2.00 minimum fee to park for up...

A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50 per hour for each hour or part thereof over three hours. The maximum charge for a

Luminous jewel polishing neckiace, Byteland county is very famous for lumin...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

What is inline function, Inline function: It is a function without prot...

Inline function: It is a function without prototype. The function is defined above main. The function should  be  declared  above  main  function.                  Declaring

What is an explicit constructor, A conversion constructor declared with the...

A conversion constructor declared with the explicit keyword. The compiler does not use an explicit constructor to execute an implied conversion of types. Its purpose is reserved ex

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