Largest Product Pallindrome
Submissions: 928   Accuracy:

19.96%

  Difficulty: Easy   Marks: 2
     

Given a value n, find out the largest palindrome number which is product of two n digit numbers.

Examples:

Input  : n = 2
Output : 9009 
9009 is the largest number which is product of two 
2-digit numbers. 9009 = 91*99.

Input : n = 1
Output : 9

Input:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains an integer n.

Output:
For each test case in a new line print the required output.

Constraints:
1<=T<=6
1<=n<=6

Example:
Input:

2
2
1
Output:
9009
9

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: Shubham Joshi 1


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.