Question: Programming Language is C Given a number N, your task is to print N, reverse number of N, sum of N with the reverse of

Programming Language is C

Given a number N, your task is to print N, reverse number of N, sum of N with the reverse of N, and reverse number from the sum of N with the reverse of N without the leading zero.

Here are the example about without leading zero: If the number is 123, then print 123

If the number is 00123, then print 123

Format Input: The first line contains an integer T - the number of test cases (1 <= T <= 100). The second line contains an integer N (1 <= N <= 10^15).

Format Output: For each test case, print "Case #X: ", where X is the test case number followed by N, reverse number of N, sum of N with the reverse of N, and reverse number from the sum of N with the reverse of N without the leading zero.

Constraints: 1 <= T <= 100 1 <= N <= 10 15

Sample Input | Sample Output

1

39 | Case #1: 39 93 132 131

Note: Reverse of N is 614.

Sum of N with the reverse is 416 + 614 = 1030.

The reverse number from its sum is 0301. Because we must print without leading zero, then we must print 301.

Please note that the output has no trailing space.

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!