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

Develop an e commerce site, We need an E Commerce site likefifacointrader. ...

We need an E Commerce site likefifacointrader. you must have experience with that kind of work You have to show a sample of work like that site. Skills required are C Prog

Rules of function, Rules of function: Inline function created witho...

Rules of function: Inline function created without prototype it reduces the memory and it is used only for small function. Inline function cannot have recursion, static var

Pointers with an array, // Basic pointer code #include "stdafx.h" #in...

// Basic pointer code #include "stdafx.h" #include iostream using namespace std; int _tmain(int argc, _TCHAR* argv[]) {             int FirstNumber, SecondNumber;

Define bitwise-shift operators, Define Bitwise-Shift Operators? The shi...

Define Bitwise-Shift Operators? The shift operators perform suitable shift by operator on the right to the operator on the left. The right operator should be positive. The va

Define meaning of call by reference - computer programming, Define the Mean...

Define the Meaning of Call by reference? In "call-by- reference", as an alternative of passing the value of a variable, the location number (or the address) of the variable is

Defines the entry point for the console application, Defines the entry poin...

Defines the entry point for the console application. // #include "stdafx.h" #include #include #include"conio.h" using namespace std; double Determinant(double a[][3],int forde

Write a program to define a matrix, Write a program to define a matrix: ...

Write a program to define a matrix: 1. Write a function that takes an integer and calculates and returns the factorial of the integer. The Factorial of a number "n" is compute

We are seeking someone to search mp3 link, Project Description: We are s...

Project Description: We are seeking someone to search mp3 link form audio or m3u8 for videos. Skills required are .NET, C Programming, Engineering, C# Programming

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