a
Write a program to implement the following operation:
(1) Input any 3-digit number j such that the absolute value of the difference between the
first and last digit exceeds 1
(2) Form a new number k by reversing the digit d.
(3) Compute the absolute difference d between j and k.
(4) Form a new number by reversing the digit d.
(5) Add m and d and check if the result is equal to 1089. If not print error implementing
above operations and stop. else print "SUM EQUALS 1089".
Answers
Answered by
0
Input: N = 21546, X = 2
Output: 25
The first two digit in 21546 is 21.
The last two digit in 21546 is 46.
The absolute difference of 21 and 46 is 25.
Input: N = 351684617, X = 3
Output: 266
Similar questions