+ 1

How to check number is palindrome or not??

JavaScript

8th May 2018, 6:58 AM
Ankita Samal
Ankita Samal - avatar
5 odpowiedzi
8th May 2018, 7:25 AM
Rahul George
Rahul George - avatar
+ 2
Ankita Samal - try posting a link to your code here so that we could help.
9th May 2018, 3:03 PM
Rahul George
Rahul George - avatar
+ 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; }
17th Sep 2018, 5:27 PM
Deep Patel
Deep Patel - avatar
0
the top website is correct
9th May 2018, 11:19 AM
priyansh neema
priyansh neema - avatar
0
but output nhi aarha h
9th May 2018, 11:27 AM
Ankita Samal
Ankita Samal - avatar