From c69856be1bb88c69f4bc5fef34789cd3ca3430e4 Mon Sep 17 00:00:00 2001 From: Tanushree Aggarwal <47485195+shreetanu@users.noreply.github.com> Date: Thu, 1 Oct 2020 00:54:00 +0530 Subject: [PATCH 1/2] Create program.c A program in C which checks whether a given number is a palindrome number or not. --- C/program-50/program.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 C/program-50/program.c diff --git a/C/program-50/program.c b/C/program-50/program.c new file mode 100644 index 00000000..0bd7302c --- /dev/null +++ b/C/program-50/program.c @@ -0,0 +1,19 @@ +#include +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; +} From 3ea790d8af0c04295d682a89f88ec1f72b6b47d3 Mon Sep 17 00:00:00 2001 From: Tanushree Aggarwal <47485195+shreetanu@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:01:54 +0530 Subject: [PATCH 2/2] Create Readme.md --- C/program-50/Readme.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 C/program-50/Readme.md diff --git a/C/program-50/Readme.md b/C/program-50/Readme.md new file mode 100644 index 00000000..06f7c7e1 --- /dev/null +++ b/C/program-50/Readme.md @@ -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