Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*palindrom*/
- #include <stdio.h>
- #include <conio.h>
- void main()
- {
- int num, org, digit = 0, rev = 0, count = 0;
- clrscr();
- printf("Enter num: ");
- scanf("%d", &num);
- org = num;
- while(num != 0)
- {
- digit = num % 10;
- rev = (rev * 10) + digit;
- num /= 10;
- count++;
- }
- if(org == rev)
- printf("Palindrom");
- else
- printf("Not palindrom");
- printf("\nReverse: %0*d", count, rev);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement