fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n;int temp;int r;
  5. int sum=0;
  6. {
  7.  
  8. printf("enter the n value ");
  9. scanf("%d",&n);
  10. for(int i=1;i<=3;i++)
  11. {
  12. temp=n;
  13.  
  14. r=n%10;
  15. sum=(sum*10)+r;
  16. n=n/10;
  17. }
  18. if(temp==sum){
  19. printf("pal is %d",temp);
  20. }
  21. else{
  22. printf("it is not palindrome %d",temp);
  23. }
  24. }
  25. return 0;
  26. }
  27.  
  28.  
  29.  
Success #stdin #stdout 0s 2116KB
stdin
545
stdout
enter the n value it is not palindrome 5