Sum of palindrome numbers in c

Sum of palindrome numbers in c. A palindrome number is a number that is equal to its reverse. 9. ", original); return 0; Output. Check if the reverse is equal to original number. I have figured out how to calculate the sum and everything but when I try to print out the sum it gives me a list of all of the numbers. Goto step 3. Approach: The problem can be solved by checking if the decimal value of the reverse of. Mar 28, 2023 · Suppose we have a palindrome of the form 123321 in base k, then the first 3 digits define the palindrome. If you stop below 100 you will always have an odd number of digits (1-9 plus pairs from the two digit numbers). Then the while loop is used until n != 0 is false ( 0 ). Codeforces. The sum of the palindromic numbers’ reciprocals is a convergent series with a value of roughly 3. 1001 is a palindrome. Declare a variable to store the sum and set it to 0. May 24, 2024 · Palindromic Number Conjecture. Hold the number in temporary variable. From which follows that every positive number less than k n generates two palindromes less than k Jan 10, 2024 · The program defines a function isPalindrome that checks if a given number is a palindrome. Dec 5, 2022 · Follow the below steps to solve the problem: Get the number. For Q queries the sum of all palindromic numbers for range [L, R] can be found as follows: sum = pref[R] - pref[L - 1] Below is the implementation of the above approach. So the 3-digit number 123 defines a 5-digit palindrome and a 6 digit palindrome. The first few for which the pronic number is palindromic are 1, 2, 16, 77, 538, 1621, Store the number in a temporary variable. Programming competitions and contests, programming community In this post we are going to see, how to print FULL PYRAMID OF NUMBERS in C++, JAVA, PYTHON which is as follows:- LeetCode Solutions in C++20, Java, Python, MySQL, and TypeScript. It helps to protect our original value and perform the manipulation on the Temp variable. If both are same, then return true, else false. The number of palindromic primes less than a given number are illustrated in the Reversed number = 5432. If both are the same, it's a palindrome otherwise not. const s = `${x}`; for (let i = 0; i < (s Note that a palindrome can have at most one digit which occurs an odd number of times - the centre digit if the number of digits is odd. Else print the number as a non-palindrome number. 1009001. Reverse that number. Input: 120. Find reverse of the given number. In this article, we will look at the C program to check Sep 11, 2023 · Sum of Digit is Pallindrome or not. If the first three digits are 100, there is one palindrome starting that way, 100,001. Find the value for N N in which X X is both over 3 3 million and is in it's self palindromic. The first being that instead of considering every number from first to last, start with the first multiple of 9 and last multiple of 9 and consider only multiples of nine. Note that, the palindrome can have even or odd number of characters. Dec 29, 2022 · Palindrome Number Program in C; Palindrome Number Program in Java; Number of palindromic paths in a matrix; Sum of all palindrome numbers present in an Array; Find a number such that sum of N with it is a Palindrome; Count numbers from a range whose cube is a Palindrome; Closest Palindrome Number (absolute difference Is min) The sum of the reciprocals of the palindromic numbers converges to a constant (OEIS A118031; Rivera), where the value has been computed using all palindromic numbers is 3. {"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":". Aug 22, 2022 · Probability that a N digit number is palindrome; Smallest and Largest sum of two n-digit numbers; Find a number such that sum of N with it is a Palindrome; Find largest number smaller than N with same set of digits; Last digit of Product of two Large or Small numbers (a * b) Next higher palindromic number using the same set of digits; Find all Feb 16, 2021 · 1. Approach: For every element of the array, if it is a one digit number then add 1 to the answer for its digit else check if the number is a palindrome. Step 4: Repeat step 5 to 8 while num. This program assumes that user always enters positive number. You signed out in another tab or window. In every loop get the last digit of the number and add that digit at the end of the reverseNum and then, divide the original number by 10. C++. Inside the function, it uses a while loop to reverse the digits of the number and compares the original number with its reversed form. 1. In other words, it has reflectional symmetry across a vertical axis. Now after 1, you have to have all digits 1-9 - nine digits. First, change the problem to finding the number of palindromic numbers between 1 and n. Inside the loop, the reversed number is computed using: reverse = reverse * 10 + remainder; Mar 27, 2023 · Follow the below steps to solve the problem. In C language, the user is allowed to enter any positive integer and to check, whether the given number is palindrome number or not by using the while loop. There are some numbers that are not palindromic in any of the bases from 2 to n−2. Check out this article for calculating sum of natural numbers using recursion. Mar 3, 2022 · For sum between [a, b] we can simply –. – Nov 29, 2023 · A given number can be said palindromic in nature if the reverse of the given number is the same as that of a given number. Apr 16, 2013 · The idea I came up with (but failed to implement) for the large problem was to precompile (generated at runtime, not hardcoded into the source) a list of all palindromic numbers less than 10^15 (there's not very many, it takes like ~60 seconds) then find out how many of those numbers lie between the bounds of each input. Let's see the palindrome program in C++. and digitCount (121) + digitCount (434) = 3 + 3 = 6. For example, a number 12321 is a palindrome, but 12345 is not a palindrome. Oct 14, 2008 · reverse = 0; remainder = 0; count = 0; while (number > reverse) { remainder = number % 10; reverse = reverse * 10 + remainder; number = number / 10; count++; } Console. Copy input string into a new string (strcpy function). If you are trying to check whether a string is palindrome or not, you can do it easily as: insert the string into a vector suppose v. A palindrome number is one that remains the same on reversal. temp=n; Called palprimes, these are prime numbers that are also palindromic. Step 5: Set d=num mod 10. Examples: Input: 121Output: yes Input: 532Output: no The approach for writing the function is to call the function recursively till the number is wholly traversed from the back. If yes then find the count of its digits and add it to the Jun 18, 2015 · Step by step descriptive logic to check palindrome number. The Ubiquitous 196: Any (?) number will become a palindrome if you reverse the digits and add, etc. Jun 29, 2023 · In this C program, we will code Sum of Digits of a Number in C we will allow the user to enter any number and then we will divide the number into individual digits and add those individuals (sum=sum+digit) digits using While Loop. WriteLine(count); if (reverse == number) { Console. printf("%d is not. Using 1234: 4321 - 1234 = 3087) Now repeat the same step with the new number. public static void Main (string[] args) {. In your school, you must have learned how to divide two numbers. 1007001. ", original); else printf("%d is not a palindrome. Add the resulted value along with the modulus of the value of ‘num’ variable. If the condition is true execute the statement. Here, the user is asked to enter an integer. For example, 12321 after reversing is 12321, so it is a palindrome number. However, the 3 digits 123 also define the palindrome 12321. Finally, if the number is found to be a palindrome then it is printed on the console. Note – An extra ‘a’ is added at the end for offset (check last part of the formula) Example – Assume you had to calculate sum b/w [3, 5]. Try It! Method 1: Let the given number be num. Store it in some variable say reverse. int isPal(int ); /*. e. Example: using System; public class Example. Some examples are 8, 121, 212, 12321, -454. {. Step 6: Set num=num/10. If the base is, say, 16, then from 100,000 to FFF,FFF in base 16, there are F00 Palindromic Prime. Algorithm: Step 2: Read number num Step 3: Set sum=0 and rev=0. Apr 27, 2023 · Else the current index of pref [] is same as the value at previous index of pref []. Let us now implement the above execution of the program to display palindrome numbers in a given range in C. Write ("Enter the Number: "); Mar 24, 2021 · Palindrome number is a number which remains same when it reverses. Find the number of distinct ways to express n n as a sum of positive palindromic integers. Hold that number in a temporary variable. h: We first scan the string. If there is such a number then the program must return this N. Example: Number: 195. WriteLine Temp = Temp /10; } printf("Rev of entered = %d\n", Rev); if ( Number == Rev ) printf("\n%d is Palindrome. sum=checkPalindrom(num); Mar 8, 2016 · First give a meaningful name to our function, say isPalindrome(). Reload to refresh your session. The first few (base-10) palindromic primes are 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, (OEIS A002385 ; Beiler 1964, p. Else, print the number as not a palindrome number. Now, to find how many palindromes there are between 1 and n, there is a trick you can use. 1010101. num = num / 10. Oct 22, 2019 · Here we will see, how to check whether a number is a palindrome or not. Explanation : 120 is not a Armstrong number of 3 digits, the sum of cubes of each digit is equal to 9 but number is 120. 1008001. Let's see the palindrome program in C. nothing else. Output: No. If there isn't then the program must return 0. As shown below: 1*1*1 + 5*5*5 + 3*3*3 = 153. 228). In each iteration of the loop, the remainder when n is divided by 10 is calculated and the value of n is reduced by 10 times. May 1, 2023 · A palindrome is a word, number, phrase, or another sequence of characters which reads the same backward as forward, such as madam, racecar, or the number 10801. First, Declare a variable reverseNum and initialize it with 0. Then the answer to the actual problem will be num(b) - num(a-1). Algorithm to check Palindrome string. In function sum () check the value of ‘num’ variable is not equal to 0. If the sum is not a palindrome, repeat this procedure until it does. This incredible mathematical hat-trick is based on the paper Every positive integer is a sum of three palindromes by Javier Cilleruelo, Florian Luca and Lewis Baxter. A palindromic prime is a number that is simultaneously palindromic and prime. Divide the value of ‘num’ variable by 10 integer value. If user enters negative number, Sum = 0 is displayed and program is terminated. cout << num; Also the output of prime numbers also is made outside a loop. It was programmed by There are even palindrome numbers which are numbers which are the same when read forward and backward. Palindrome number algorithm. (e. Take two inputs n1 and n2. temp = num; remainder = num % 10; reverse = reverse * 10 + remainder; num /= 10; Aim: Write a C program to find the sum of digits and the reverse of a number. lastDigit = num % 10. The user enters a number indicating how many numbers to add and the n numbers. g. Mar 4, 2014 · This shortcuts when it's impossible to return an i*j > the largest recorded and correctly returns 906609 (note, if you're in python 2, the below would work for you, but you'd prefer to use xrange instead of range to avoid creating unnecessary lists in memory): We would like to show you a description here but the site won’t allow us. Compare num with reverse. Two ways are considered different if the frequency of at least Jan 9, 2016 · To check whether a number is palindrome is not we have to reverse the number and compare it with original number. What is the sum of all numeric palindromes that are less than 10,000? My code so far is: Nov 6, 2016 · This problem can actually be done in logarithmic time. In this c program, we will get an input from the user and Aug 6, 2018 · Multiply rev ( Intially 0) by 10 and add the above digit to it. Let's call some positive integer a a without leading zeroes palindromic if it remains the same after reversing the order of its digits. It can be of odd or even length. But the number 1232 after reversing is 2321, so it is not a palindrome number. In this java program, we will get a number variable and check whether number is palindrome or not. 1 until there is atleast a digit left in the number. Sep 26, 2023 · Palindrome Number Program in C. Let's see the palindrome program in java. Approach: Initialise flag to unset int flag = 0. Add last digit found above to sum i. temp=num; sum=0; Here is source code of the C program to reverse a number & checks it is a palindrome or not. Create the reverse of the number. Nov 16, 2023 · Given a number, the task is to write a recursive function that checks if the given number is a palindrome or not. Input : n = 46355364 Output: Reverse of n = 46355364 Palindrome : Yes Jul 21, 2021 · I´m learning C and doing the second task which is to check if an integer is a palindrome. Oct 28, 2019 · If the interval is, in decimal, from 100000 to 999,999, then there are exactly 900 palindromes. Mar 13, 2021 · isPalindrome(i) method verifies if the current number is palindrome or not. In the main function check if res is equal to 1 or not. \n", Number); . Iterate through all the nodes of the linked list and check if the current node value is a palindrome or not. For instance, the number 2 divided by 10 gives the remainder 2 (the sum of a digit of the number 2). Divide the number by 10 with help of Let's see the palindrome program in C#. Finally you will be left with the sum of digits in sum. reverse the vector v and insert it to another vector called suppose v1. Mar 17, 2023 · If same then the number is a palindrome. Below is the implementation of above Approach: Feb 25, 2021 · I'm trying to get the sum of the palindrome numbers in an array with javascript The code gets outputs 0 instead of getting the sum of palindrome values: function reverse(n) { var rem, res = Sum of n numbers in C: This program adds n numbers that a user inputs. Example of Palindrome Number. using namespace std; int main () {. After the loop has ended, If the flag is set to 1 then print “Not Palindrome” else print “Palindrome”. Time Complexity: O(log n) The above program for checking palindrome number has a time complexity of O(n) as inside the while loop the value of n reduces to n/10 in each Mar 31, 2020 · This is by no means an optimized solution and it is adapted from your idea with a couple exceptions. Auxiliary space: O (1) because constant variables have been used. Along with this declare and define another function to find reverse of number, say int reverse(int num);. The term palindromic is derived from palindrome, which refers to a word (such as rotor or racecar) whose spelling return 0; } Output. Sum of all N-digit palindromic numbers which doesn't contains 0 and are divisible by 9; Recursive program to print all numbers less than N which consist of digits 1 or 3 only; Generate all palindromic numbers less than n; Find a number such that sum of N Apr 6, 2023 · A naive approach will be to check every even length number, if it is a palindrome number then we sum it up. Remove last digit from number by dividing the number by 10 i. Don’t worry here is an example suppose we have to print palindromes between the given range of numbers. The function sum () is used to find sum of digits of a number using recursion. Sep 11, 2023 · C++ program to find all numbers less than n, which are palindromic in base 10 and base 2. h>. Create a method that takes 2 inputs n1 and n2 and return the sum of the palindrome. Between 10 and 30 . Step 8: Set rev=rev*10+d. Use a while loop to reverse the numbers within the range. Repeat step 2-4 till number becomes 0. // declaring the recursive function. Step 2: Get the sum of all digits of the original number and store it another variable A. C language has an operator '%' (don't confuse it with the percentage symbol of maths) that returns the remainder. Get the rightmost digit of the number with help of the remainder ‘%’ operator by dividing it by 10 and adding it to the sum. We repeat the same process for first K even length palindrome numbers and sum them up to get the sum. Get the number from user. Sum = 1275. A palindromic number is a number (in some base b) that is the same when written forwards or backwards. int r,sum=0,temp; int n=454;//It is the number variable to be checked for palindrome. using System; public class PalindromeExample. Also learn – Program to check palindrome string. We can do it by using an array and without it. You need to write. Examples: (5) 10 = (101) 2 which is palindrome. Input: arr [] = {56, 455, 546, 234} Output: 0. If both numbers are same, print palindrome number. We then copy it to another string as well. i've just suggested a method to check palindrome. Enter a positive integer: 50. Step 3: Reverse the number of variable A and store into B. The program output is also shown below. If yes : add to the sum (final result) Redo Step 3. In the case of an Armstrong number of 3 digits, the sum of cubes of each digit is equal to the number itself. int isPalindrome(int number) {. Apply the 196-algorithm, which consists of taking any positive integer of two digits or more, reversing the digits, and adding to the original number. class PalindromeExample {. This is my code: int num,sum; int lim; cout << "Insert limit number: "; cin >> lim; cout << "Palindrome numbers within the limit are: "; for(num>0;num<=lim;num++){. #include <iostream>. gitignore","path":". You switched accounts on another tab or window. { public static void Main ( string [] args) { int num, x, sum =0, y; Sep 11, 2023 · Generate all palindromic numbers less than n; Sum of all N digit palindrome numbers; Probability that a N digit number is palindrome; Largest palindromic number in an array; Print all permutations of a number N greater than itself; Smaller palindromic number closest to N; C++ program to find all numbers less than n, which are palindromic in Jun 13, 2015 · To get last digit modulo division the number by 10 i. ( N in base B) is palindrome or not. Let's say given number range is 10,30. Next, the isPalindrome() function takes an integer to find reverse as input. Print the number as a palindrome number, if both the numbers are the same. Print the sum. Of the first numbers, only 251 do not produce a palindromic number in steps (Gardner 1979). Use a temp variable to store the reverse of the number acc Jan 23, 2014 · 0. In this example, you will learn to calculate the sum of natural numbers entered by the user in C programming with output standard output. To check if a number is a palindrome or not, we reverse it and compare it with the original number. Write a C,C++ program to count number of palindrome number between given range. Time complexity: O (log N) for a given input. Example1. Therefore, the required output is Yes. In a loop check if arr [i]! = arr [n-i-1] then set the flag = 1 and break. Sep 29, 2018 · Algorithm to find the sum of palindrome in the range. function isPalindrome(x) {. Following is the C Program to find Palindrome number by using the while loop −. isPalindrome(int num);. Regarding sums, the following are a few facts about palindromic numbers: Every positive integer may be expressed as the sum of three palindromic integers in every number system with a base of 5 or more, according to research released in 2018. Word palindromes If both numbers are same, print palindrome number. If yes, I shall return the number; if not, I shall sum up the number and the number with reversed digits and check again. For example, for the number 11, the output is this 1 3 6 10 15 21 28 36 45 55 66 So, it is the magic number. c","path":"ATM Mar 27, 2023 · Explanation : 153 is an Armstrong number of 3 digits, since the sum of cubes of each digit is equal to the number itself. Output: 163. You do not need to count them individually. Create a variable sum = 0. Else print not palindrome number. Almost all numbers can be made into a Palindromic number by carrying out the following algorithm: Take the number, reverse it and subtract the smaller from the larger. We divide a number by 10 (divisor), find the remainder, and store it. A palindrome string is one that reads the same backward as well as forward. Apr 18, 2023 · Sum of first K even-length Palindrome numbers; Count of N digit palindromic numbers divisible by 9; G-Fact | All palindromes with an even number of digits are divisible by 11; Program to check the number is Palindrome or not; Given a number, find the next smallest palindrome; All palindrome numbers in a list; Palindrome Number Program in C You signed in with another tab or window. This program can also be done using recursion. A Palindrome is a word, string, number or any sequence that reads same forward and backward. The main function tests the palindrome check for numbers in the range 100 to 200 and prints the palindrome numbers. Input a number from user. List of palindromes. So, for any value of N, the count of N-digit palindromes will be 9 * 10(N – 1 8. C program to check if a string or a number is palindrome or not. return 0; } In this C Palindrome Program, We assign the original number to the Temp variable. 1999. global declaration to use the same value. This program takes integer input from the user. If both numbers are the same, then print it as a palindrome number else, print it as not a palindrome number. int n,r,sum=0,temp; Console. \n", Number); else. At last, just print the value of the C String Programs C Program to Print String C Hello World Program C Program to Add n Number of Times C Program to Generate Random Numbers C Program to Check whether the Given Number is a Palindromic C Program to Check Prime Number C Program to Find the Greatest Among Ten Numbers C Program to Find the Greatest Number of Three Numbers C Program to Asks the User For a Number Between 1 to 9 C A Palindrome is a sequence that if reversed looks identical to the original sequence Eg : abba, level, 999 etc. I am trying to find all the palindrome numbers under a given limit number using a check function. Now Alina wants to find some positive number of same length without leading zeroes, such that the sum of these two numbers is a palindrome. You are given a positive integer n n. Repeat the next two steps till the number is not 0. Compare the temporary number with reversed number. The input number G will be given through a txt file consisted only by 1 line. Step 7: Set sum=sum+d. Feb 26, 2016 · I am having trouble printing out the sum of a palindrome without using ant string methods and only using mathematical methods. Palindrome statistics: Some general facts about palindrome numbers. Check the reverse numbers are the same as that number and keep it in the variable sum. (so here we would do 7803 - 3087 = 4716. rev = (rev * 10) + digit; num = num / 10; } while (num != 0); cout << num; Moreover the comparison in the if statement above is incorrect. Follow the steps below to solve the problem. For 101, there is also one: 101,101. Palindrome magic squares: Magic squares constructed with palindromes or a palindrome magic sum. Live Demo Mar 17, 2021 · Given an integer N, the task is to check if. Oct 31, 2023 · Approach: Create a reverse and add function to start with a number, reverses its digits, and adds the reverse to the original. This page lists the palindromes. 37028. Jan 11, 2023 · Explanation: The sum of palindrome numbers {22, 212, 44, 4, 3} is 285. Store it in some variable say num. I tried to return the sum, if the sumpal (sum of all palindrome numbers) is not single digit, getting a single digit sum is all I tried. During a daily walk Alina noticed a long number written on the ground. 2000. WriteLine("Your number is a palindrome"); } else { number = number * 10 + remainder; if (reverse == number) Console. 1 for all numbers in L and R. If both reversed number and original numbers are same then given number is palindrome number and add it the sum of all palindrome numbers. 195 + 591 = 786; 786 + 687 = 1473; 1473 + 3741 = 5214; 5214 + 4125 = 9339 (is palindrome) Aug 18, 2022 · Sum of all odd length palindromic numbers within the range [L, R] Sum of all i such that (2^i + 1) % 3 = 0 where i is in range [1, n] Find the sum of the first N Dodecagonal Numbers; Sum of first K even-length Palindrome numbers; All palindrome numbers in a list; C++ Program to Check Whether a Number is Palindrome or Not If P is smaller than Q−1 then choosing base Q−1 we have N = {P,P}Q−1, a palindrome. Doing b* (b+1)/2 – a* (a+1)/2 what we have done is subtracted (1, 2, 3) from Jan 20, 2023 · Output: Not Palindrome. Step 4: After that, multiply the values It really does work for any number - scroll back up and try another one. Approach 1: Using the inbuilt C functions from string. 370001832. For e. g: MADAM, NAN, 12321, ANNA etc. But I could not return the value of total sum , it was returning 0. Compare both the numbers. The Palindromic Number Calculator. Now, make a while loop till the original number is greater than zero. A simple method for this problem is to first reverse digits of num, then compare the reverse of num with num. After the do-while loop the value of num is equal to 0. Therefore, pass an integer value to the function i. Approach: The first digit can be any of the 9 digits (not 0) and the last digit will have to be same as the first in order for it to be palindrome, the second and the second last digit can be any of the 10 digits and same goes for the rest of the digits. In this program, we will get an input from the user and check whether number is palindrome or not. #include <stdio. Divide the original number by 10 to remove the previous digit. Algorithm to check Palindrome Number in C#: First, get the number from the user which you want to check. If it is equal to 1 print the number as palindrome number. . Following is an interesting method inspired from method#2 of this post. Oct 27, 2020 · Aman, sumpal is the sum of all the palindrome numbers in the array in my code . The palindrome numbers are the same in both directions. For example, 4 = 1002 is not a palindrome; 6 = 1102 = 203 = 124 none of which are palindromes but 7 = 1112 is a palindrome. In this tutorial, we will explore a C++ program designed to check whether a given number is a palindrome. if v == v1, then palindrome, otherwise not. The C program is successfully compiled and run on a Linux system. Palindrome number in C. sum = b* (b+1)/2 – a* (a+1)/2 + a. public static void main (String args []) {. In this article, we will write a Program to check if a number is a Palindrome Number in Java. Now sum the two and repeat the procedure with the sum. Dec 16, 2022 · Only 121 and 434 are palindromes. A Palindromic number is a number that reads the same when the digits are read backward (such as 121 or 11211). A palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number (such as 16461) that remains the same when its digits are reversed. Sep 15, 2017 · X X is the sum of the first N N palindromes. Below is a simple C program to find whether the user input number is a palindrome or not using recursion: #include<stdio. Step 1: Declare an integer type variable and input a number from the user to store it in N. Reverse the number. Steps to find the Magic number in C. int n,r,sum=0,temp; Jul 17, 2020 · Here's my code: def ispalindrome(p): temp = p rev = 0 while temp != 0: rev = (rev * 10) + (temp % 10) temp = temp // 10 if num == rev: return True else: Mar 10, 2022 · Output: 9. We used JS to create a function which finds lower values, but the integers are too large to find a solution where x is greater than 3m. Approach: In order to solve this problem we are using an approach similar to calculate the Sum of all Palindromes in an Array. Palindrome numbers are those numbers which after reversing the digits equals the original number. sum = sum + lastDigit. Palindrome number. You don't have to count/find actual palindromes. gitignore","contentType":"file"},{"name":"ATM HS08TEST. 1998. Compare the temporary number with the reversed number. reversed = reversed * 10 + remainder; n /= 10; // palindrome if orignal and reversed are equal if (original == reversed) printf("%d is a palindrome. For example, 153 is an Armstrong number because Jan 11, 2024 · A palindrome number reads the same backward as forward. Input: 19 -> 22 -> 141. For example range is {10,122} then output should be {11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121} How to Implement palindrome in C++? Below are the different examples to implement palindrome in Apr 22, 2016 · So given any natural number G (1≤G≤10^100000) write a program in C that tests if G can occur by the sum of a natural number N and its reverse Nr. Loop the array till size n/2. If both are same then the number is palindrome otherwise not. is equal to N or not. oc gd jp tz jj hp mp rk na kh