Write a complete C++ program with the following information.

a) Write a complete C++ program with the following information.
Define a class having data member string of 20 characters. Define default constructor,
getdata() and print() functions. Define the following member functions without using string.h file:
i) A member function receives an object of the class as an argument and compares it
with the invoking object. If the strings are not equal it returns 0 else 1.
ii) A member function returns the string length of invoking object.
iii) A member function checks whether the data member of invoking object is palindrome
or not. If the string is palindrome, it returns 1 else 0. (Palindrome means reverse of the
string is same as the original one.)

Leave a Reply