Question: Please write code Petra likes to look at things from all angles. When it comes to numbers, she likes to look at the relationship between

Please write code
Please write code Petra likes to look at things from all angles.

Petra likes to look at things from all angles. When it comes to numbers, she likes to look at the relationship between a number and its reverse. The reverse of 135 is 531 . The reverse of 980 is 089 which is actually 89 . The reverse of 5 is 5 . Your job is to find the greatest common factor of an input number and its reverse. Input: Input will consist of an integer N, the number of test cases. The number of test cases will be in range [1,20]. Each subsequent line will contain one integer in the range [1,1000000] representing the number to be tested. Output: Each line of output will consist of one integer representing the greatest common factor of the input with its reverse. Sample input: 5214470036912345 Sample output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!