Initial Basics – Algebra – Problem #31
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Difficulty: Medium
Problem Statement
If a five-digit number is taken as input through the keyboard, write a C program to print the difference of the sum of the last three digits from the sum of the first two digits of the number. Also use one single integer variable to generate the reverse of the last three digits and print that single integer [Hint: Use positional notation for decimal numbers to generate the reverse number.]. Example: Input: 97321 Output: Difference = 10 (sum of (9,7) - sum of (3,2,1)) Reverse number = 123 (as a single integer)