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

What does it mean to declare a function as a static, (c) A static member fu...

(c) A static member function can access static member data only, static member functions and functions and data outside the class. A static member function may be called, even whil

Program to calculation of mortgage interest rates, This assignment builds o...

This assignment builds on Homework 3. The two major modifications are the instruction of pointers and the calculation of mortgage interest rates. Requirements for Project 2:

Program to calculate pie, This problem familiarizes you with using random n...

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of π using a simulation method called "Monte Carlo". The following fi

Poop, hwat is the area fsdjlakl;aeklfjtealrtl;gka

hwat is the area fsdjlakl;aeklfjtealrtl;gka

Arrays, how to declare arrays

how to declare arrays

Stack push pop, 2 flowcharts, pseudocode for each (at least 4 algorithms), ...

2 flowcharts, pseudocode for each (at least 4 algorithms), and code for either a stack or a queuestion..

Padovan string, write a program that counts the number of occurrences of th...

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n)   program in java // aakash , suraj , prem sasi kumar kamaraj college

What is some reward/drawback of using friend functions?, A: They present a ...

A: They present a degree of freedom in the interface design options. Member functions & friend functions are equally privileged (100% vested). The major difference is that a fri

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