Advertisement
hasib_mo

palindromic

Mar 9th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include<stdio.h>
  2. int check(int a)
  3. {
  4. int ultano;
  5. for(;a>0;a=a/10)
  6. {
  7. ultano=ultano*10+a%10;
  8. }
  9. if (ultano==a)
  10. {
  11. return 1;
  12. }
  13. else
  14. {
  15. return 0;
  16. }
  17. }
  18.  
  19. int main()
  20.  {
  21. int a,b;
  22. printf("enter lower limit:");
  23. scanf("%d",&a);
  24. printf("enter upper limit:");
  25. scanf("%d",&b);
  26. for(int i=a;i<=b;i++)
  27. {
  28. if(check(i))
  29. {
  30. printf("%d\n",i)
  31. }
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement