Skip to content

Commit c9ccbdb

Browse files
Merge pull request seeditsolution#55 from Prateek6125/patch-2
Palindrome no.
2 parents ccd16cd + 0e7d520 commit c9ccbdb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Palindrome no.

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include<stdio.h>
2+
int main(){
3+
int num, rem, reverse_num, temp, start, end;
4+
5+
printf("Enter the lower limit: ");
6+
scanf("%d",&start);
7+
8+
printf("Enter the upper limit: ");
9+
scanf("%d",&end);
10+
11+
printf("Palindrome numbers between %d and %d are: ",start,end);
12+
for(num=start;num<=end;num++){
13+
temp=num;
14+
reverse_num=0;
15+
while(temp){
16+
rem=temp%10;
17+
temp=temp/10;
18+
reverse_num=reverse_num*10+rem;
19+
}
20+
if(num==reverse_num)
21+
printf("%d ",num);
22+
}
23+
return 0;
24+
}

0 commit comments

Comments
 (0)