Answers for "c palindrome int program"

C
0

Palindrome number in c program

#include<stdio.h>
void main(){
    int num, cNum, rev, rem;
    printf("Enter a number = ");
    scanf("%d",&num);   //0

    cNum = num; //123
    rev = 0;
    while(cNum != 0){
        rem = cNum % 10;
        rev = rev * 10 + rem;
        cNum /= 10;
    }
    if(num == rev){
        printf("Palindrome");
    }
    else{
        printf("Not Palindrome");
    }
}
Posted by: Guest on February-24-2022

Code answers related to "c palindrome int program"

Code answers related to "C"

Browse Popular Code Answers by Language