+ 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"
2 Antworten
+ 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! : )
+ 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;
}