**L**et’s Try (r-1)’s and r’s complement. **How to get (r-1)’s complement of decimal number…?**

**Say**** **r =10

**How do we get (r-1)’s complement …?**

(r-1)′s i.e. 9’s complement of decimal number can be obtained by ((10^{n} – 1)-number)

where n represents the number of digits in the given number.

**Example 1: ****Find 9’s complement of (1234)**_{10}

9′s complement = 10^{4}-1-1234 = 9999-1234 = 8765

**How do we get (r)’s complement …?**

r’s i.e. 10’s complement can be obtained by (10^{n} – number)

where n represents the number of digits in the given number.

**Example 2: ****Find 10′s complement = 10**^{4}**-1234 = 8766.**

Now that we have learned to convert decimal numbers to their 9′s & 10′s complements, we will move to subtraction using them. Remember always the number to be subtracted or the negative number is converted to 9′s or 10′s complement.

(r-1)’s and r’s complement examples