Largest Product Pallindrome
Submissions: 1005   Accuracy:

20.86%

  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


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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

to report an issue on this page.