+ 1
How to check number is palindrome or not??
JavaScript
5 Réponses
+ 4
" Two Ways to Check for Palindromes in JavaScript"
https://medium.freecodecamp.org/two-ways-to-check-for-palindromes-in-javascript-64fea8191fd7
" Write a program to check whether a given number is a
palindrome or not?"
https://www.allinterview.com/showanswers/115377/write-a-program-to-check-whether-a-given-number-is-a-palindrome-or-not.html
" Check number is palindrome or not in JavaScript"
https://www.includehelp.com/code-snippets/check-number-is-palindrome-or-not-in-javascript.aspx
+ 2
Ankita Samal - try posting a link to your code here so that we could help.
+ 2
//not only number but string also
#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;
}
0
the top website is correct
0
but output nhi aarha h