Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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");
    }
}
Source by youtu.be #
 
PREVIOUS NEXT
Tagged: #Palindrome #number #program
ADD COMMENT
Topic
Name
7+5 =