Friday, August 31, 2018

String Palindrome in C++

In this article I would like to share with you my more improve string palindrome program that I wrote using C++ for my upcoming book on C++ programming I hope you will find my work useful.

I am currently accepting programming work, it project, school 

programming projects , thesis and capstone projects, IT consulting 

work, computer tutorials and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.com, jakerpomperada@aol.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

// palindrome.cpp
// Author    : Mr. Jake R. Pomperada, BSCS,MAED-IT
// Date      : August 31, 2018   Friday  9:32 PM
// Location  : Bacolod City, Negros Occidental Philippines.
// Website   : http://www.jakerpomperada.com
// Email     : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com

#include <iostream>
#include <string.h>
#include <conio.h>

#define size 50

 using namespace std;

 main()
    {
    char strsrc[size];
    char strtmp[size];
    char reply=0;
    do {
    system("cls");
    system("COLOR F0");  
    cout << "\n\n";
    cout << "\t\t PALINDROME CHECKER 1.0";
    cout << "\n\n";
    cout <<"\tEnter a String : => ";
        gets(strsrc);
    strcpy(strtmp,strsrc);
    strrev(strtmp);
    cout << "\n\n";
    if(strcmpi(strsrc,strtmp)==0) {
    cout << "\tEntered String " << strsrc << " is Palindrome.";
    }
    else {
    cout << "\tEntered String " << strsrc << " is Not Palindrome.";
    }
cout << "\n\n";
cout <<"\tDo You Want to Continue? Y/N : ";
reply = toupper(getch());
} while (reply =='Y');
cout << "\n\n";
cout <<"\tThank you for Using This Software !!!";
cout <<"\n\n";
system("PAUSE");
 }

No comments:

Post a Comment