Question

Print palindrome number in an array.

```				```
Input:
ENTER THE SIZE OF ARRAY:10
ENTER THE ELEMENT IN THE ARRAY:
1 2 3 4 5 6 7 8 9 10

ARRAY AFTER DELETING EVEN POSITION ELEMENTS:
2 4 6 8 10
```
```

Code

```				```
import java.util.Scanner;
{
public static void main(String[] args)
{
/* Initialize array */
int [] arr;

int n=0,i=0,j=0,count=0,remainder=0,temp=0,reversedInteger=0;
Scanner sc = new Scanner(System.in);

System.out.println("Enter a number of elements in the array");
n = sc.nextInt();
arr=new int[n];
System.out.println("Enter numbers in array");

for(i=0;i< n;i++)
{
arr[i]=sc.nextInt();
}

/* printing palindrome elements in an array */
System.out.println("palindrome Elements in an array");
for(i=0;i< n;i++)
{
temp=arr[i];
reversedInteger=0;
// reversed integer is stored in variable
while( temp != 0 )
{
remainder = temp % 10;
reversedInteger = reversedInteger * 10 + remainder;
temp /= 10;
}

<span id="comments"> /* palindrome if n and reversedInteger are equal*/</span>
if (arr[i] == reversedInteger)
{
System.out.println(n + "  ");
}

}

}
}
```
```

Sale

50
Sale

150
Sale

200
Sale

50
Sale

50
Sale

50
Sale

50
Sale

50
Sale

50