To convert a number from decimal (base 10) to octal (base 8), you can use the following steps:
### Method 1: Repeated Division
1. **Divide the Decimal Number by 8:**
- Write down the decimal number you want to convert.
- Divide it by 8, noting both the quotient and the remainder.
2. **Record the Remainder:**
- The remainder will be a digit in the octal system (it will be between 0 and 7).
3. **Repeat the Division:**
- Use the quotient from the previous division as the new number to divide by 8.
- Record the remainder.
4. **Continue Until the Quotient is Zero:**
- Keep dividing by 8 and recording the remainders until the quotient is zero.
5. **Write Down the Octal Number:**
- The octal number is obtained by reading the remainders in reverse order (from last remainder to the first).
### Example: Convert Decimal 156 to Octal
1. **Divide 156 by 8:**
- Quotient = 19, Remainder = 4
2. **Divide 19 by 8:**
- Quotient = 2, Remainder = 3
3. **Divide 2 by 8:**
- Quotient = 0, Remainder = 2
4. **Read the remainders in reverse order:**
- Octal Number = 234
So, the decimal number 156 is equivalent to octal 234.
### Method 2: Using Built-in Functions
In many programming languages, you can convert decimal to octal directly using built-in functions or methods. For example:
- **Python:** `oct(decimal_number)`
- **JavaScript:** `decimal_number.toString(8)`
- **Java:** `Integer.toOctalString(decimal_number)`
Using these methods can simplify the conversion process, especially for larger numbers.
Let me know if you have any more questions or need further clarification!