Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is conservative approach ?

Answered: 1 week ago

Question

What are the basic financial decisions ?

Answered: 1 week ago