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)

Back to Lab Problems
Initial Basics/Algebra/Problem #31

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #31

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.