C Program to check whether given Integer is Palindrome or Not

Sample Input 1 :

656

Sample Output 1 :

Palindronme (Reverse of 656 is 656)

Flow Chart Design

C Program to check whether given Integer is Palindrome or Not Flow Chart

Try your Solution

Strongly recommended to Solve it on your own, Don't directly go to the solution given below.

#include<stdio.h> int main() { //write your code here }

Program or Solution

				
			
					
#include<stdio.h>
int main()
{
	int num,rev,rem;
	scanf("%d",&num);
	while(num!=0)
	{
		rem=num%10;
		rev=rev*10+rem;
		num/=10;
	}
	printf("Reverse is %d",rev);
	return 0;
}
		
			
				
			

Output

C Program to check whether given Integer is Palindrome or Not Output

Program Explanation

refer video tutorial

Comments