Question: Using C Q3 Write a program that does the following: Accepts a 1 to 10-digit number from the user i) Reverses the order of digits
Using C
Q3 Write a program that does the following: Accepts a 1 to 10-digit number from the user i) Reverses the order of digits to form a new number ii Defines a function int rev_digits(int num1) that accepts an integer of upto 10 digits and reverses it (23 for 32, 123 for 321, 123456 for 654321) iii Prints the difference between the original number and the reversed number iv) Is flexible enough to read 1 to 10-digit numbers and run successfully v)Output in the following format: Input an integer to be reversed. The difference between the original number 23 and the reversed number 32 is -9 Input an integer to be reversed. 23456 The difference between the original number 23456 and the reversed number 65432 is -41976 nput an integer to be reversed 123456789 The difference between the original number 123456789 and the reversed number 987654321 is -864197532
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
