Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6c90d95

Browse files
authored
Create 42 check palindrome.c
1 parent 93eca04 commit 6c90d95

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎Array/Problems/42 check palindrome.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include<stdio.h>
2+
int main()
3+
{
4+
int n,r,sum=0,temp;
5+
printf("enter the number=");
6+
scanf("%d",&n);
7+
temp=n;
8+
while(n>0)
9+
{
10+
r=n%10; // getting the reminder
11+
sum=(sum*10)+r; // storing in sum
12+
n=n/10; // redusing the number
13+
}
14+
if(temp==sum)
15+
printf("palindrome number ");
16+
else
17+
printf("not palindrome");
18+
return 0;
19+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /