Program to check whether String is palindrome or not C++

A simple program to check whether String is palindrome or not C++ PROGRAM: #include<iostream> using namespace std; int main( ) { int L,C; char str[80]; cout<<“nEnter a string: “; gets(str); for(L=0;str[L]!=”;L++); //To find length of the string for(C=0;(C<L/2) && (str[C]==str[L-C-1]);C++); if(C==L/2) cout<<“ntString is Palindrome”; else cout<<“ntNot a palindrome”; return 0; }   OUTPUT:

Program to Find length of String C++

This is a simple program to find Length of a String in C++. Just traverse the string till NULL (‘’), increment the ‘i’ likewise. Program to Find length of a String C++ #include<iostream> using namespace std; int main( ) { int i; char str[80]; cout<<“Enter a string:”; gets(str); for(i=0;str[i]!=”;i++); cout<<“Lenght of string is :”<<i; return 0; }   OUTPUT: