-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3Digit.c
More file actions
26 lines (24 loc) · 825 Bytes
/
3Digit.c
File metadata and controls
26 lines (24 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h> // Library File aka Header File
int main (void)
{
int d = 0; // Declared and initialized
printf("Enter Number: "); // Ask User for input
scanf("%d",&d);
int o = d % 10; // For Getting Last Digit
int i = d / 10;
int t = i % 10; // For getting Second Last Digit
int h = i / 10; // Starting Digit
printf("%d\t%d\t%d",h,t,o); // Print Value
// For Check whether the number is palindrome
int palin = (o * 100) + (t * 10) + h;
// Condition Starts
if (palin == d)
{
printf("\nThis Number is Palindrome");
}
else
{
printf("\nNo, It's not the Palindrome number!!");
}
return 0;
}