Printing i th Palindrome -C++
#include<bits/stdc++.h>
using namespace std;
int main()
{
int ara[100];
int count=1,i;
for(i=1;i<100;i++)
{
int temp=i;
int rem;
int sum=0;
while(temp!=0)
{
rem=temp%10;
sum=sum*10+rem;
temp=temp/10;
}
if(i==sum){
ara[count]=i;
count++;
}
}
int k;
cin>>k;
cout<<ara[k]<<endl;
return 0;
}
No comments