Draw Flow Chart of Palindrome Number

Flow Chart of Palindrome Number

Draw Flow Chart of Palindrome Number
 

What is Palindrome Number

A palindrome is actually the reverse of a number. Suppose we have a number and if we take the reverse of the number then next number that we have is equal to the original number is called palindrome 
 

Flow Chart of Palindrome

Draw Flow Chart of Palindrome Number
 

Example of Palindrome

Consider the number 1221
If we take the reverse of the number then the resultant number will be 1221 hence both numbers are same and the number 1221 is palindrome number
 

Program of Palindrome in C++

 
#include <stdio.h>

 

void main(){

 

int num,r,sum=0,t;

 

printf(“Input a number: “);

 

scanf(“%d”,&num);

 

for(t=num;num!=0;num=num/10){

 

r=num % 10;

 

sum=sum*10+r;

 

}

 

if(t==sum)

 

printf(“%d is a palindrome number.n”,t);

 

else

 

printf(“%d is not a palindrome number.n”,t);

 

}

 

 

Output

Input a number: 1221
1221 is a palindrome number