To check whether an entered string is a palindrome or not.(Netbeans) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

To check whether an entered string is a palindrome or not.(Netbeans)

Examples of a palindrome. the word "madam" when reversed gives us "madam". or The word "wow"

15th Sep 2018, 5:43 AM
Arya Jad
Arya Jad - avatar
2 Answers
+ 2
Go to Code Playground https://www.sololearn.com/Codes/ And type "palindrome" (without quotes) in Search bar, next, pick Java from language filter menu to the right most side from the Search bar, you'll see loads of examples to learn from. Good luck! : )
15th Sep 2018, 6:05 AM
Ipang
+ 1
//c++ code Might get help #include <iostream> #include <stdlib.h> using namespace std; int main(){ int n=0; string s; cout<<"Enter String: "; cin>>s; for(int k=s.length()-1,i=0 ; k>=0,i<s.length() ; --k,++i){ if(s[k]==s[i]){ n++; } } if(n==s.length()){ cout<<"Palindrome"; }else{ cout<<"not Palindrome"; } return 0; }
17th Sep 2018, 5:25 PM
Deep Patel
Deep Patel - avatar