Given a decimal number N. The task is to find 10’s complement of the number N.
Input : 25 Output : 10's complement is : 75 Input : 456 Output : 10's complement is : 544
10’s complement of a decimal number can be found by adding 1 to the 9’s complement of that decimal number. It is just like 2s compliment in binary number representation.
10’s complement = 9’s complement + 1
For example, let us take a decimal number 456, 9’s complement of this number will be 999-456 which will be 543. Now 10s compliment will be 543+1=544.
10’s complement = 10len – numWhere, len = total number of digits in num.
Below is the program to find 10’s complement of a given number:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- What’s difference between 1's Complement and 2's Complement?
- 9's complement of a decimal number
- Convert Decimal To Hexa-Decimal including negative numbers
- 1's and 2's complement of a Binary Number
- Check if binary representation of a given number and its complement are anagram
- 8085 program to find 1's and 2's complement of 8-bit number
- 8085 program to find 1’s and 2’s complement of 16-bit number
- Previous number same as 1's complement
- Interface 8255 with 8085 microprocessor for 1’s and 2’s complement of a number
- Complement of a number with any base b
- Efficient method for 2's complement of a binary string
- Check if one of the numbers is one's complement of the other
- Find One's Complement of an Integer
- Find relative complement of two sorted arrays
- 8085 program to find 2's complement of the contents of Flag Register
- Check if bits in range L to R of two numbers are complement of each other or not
- Why are negative numbers stored as 2's complement?
- Subtraction of two numbers using 2's Complement
- Maximize Bitwise AND of first element with complement of remaining elements for any permutation of given Array
- Count number of digits after decimal on dividing a number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.