Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions C/program-50/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Program 50

Write a program to check whether a given number is a palindrome or not.

Variable description--

n=Holds the element which is to be checked

temp=Holds the copy of the element

rev= Holds the reverse of the number

rem=Holds the digits of the number
19 changes: 19 additions & 0 deletions C/program-50/program.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include<stdio.h>
int main()
{
int rem,rev=0,temp,n;
printf("Enter the number");
scanf("%d",&n);
temp=n;
while(n>0)
{
rem=n%10;
n=n/10;
rev=rem+(rev*10);
}
if(temp==rev)
printf("number is palindrome");
else
printf("number is not palindrome");
return 0;
}