Post Top Ad

Your Ad Spot

Pages

Sunday 9 February 2020

Display Nth Pelindrome Number


#include<stdio.h>
#include<conio.h>

int RevNo(int no)

     int i,res=0;

 for(i=no;no;i++)
  {
  res=res*10+no%10;
  no=no/10;
  
  }
  return res;
}
int IspelindromeNonward(int n)
{
  int i;
  int c=0;
  
for(i=0;c<n;i++)
{
 
   if(RevNo(i)==i)
   { 
  c++;
  
   }
}
printf("%d",i-1);
}  
void main()

   IspelindromeNonward(17);
}

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages