#include <codecogs/computing/base/dec_to_oct.h>
using namespace Computing::Base;
| int | dec_to_oct (int val) Converts a decimal number into octal number | |
| Integer | cc_dec_to_oct (Integer val) This function is available as a Microsoft Excel add-in. |
| intdec_to_oct( | int | val | ) |
01234567
Therefore the first set of Octal number are as follows
| Octal | Decimal | |
|---|---|---|
| 0 | 0 | zero |
| 01 | 1 | one |
| 02 | 2 | two |
| 03 | 3 | three |
| 04 | 4 | four |
| 05 | 5 | five |
| 06 | 6 | six |
| 07 | 7 | seven |
| 010 | 8 | eight |
| 011 | 9 | nine |
| 012 | 10 | ten |
| 013 | 11 | eleven |
| 014 | 12 | twelve |
#include <stdio.h> #include <codecogs/computing/base/dec_to_oct.h> int main(void) { int num; printf("Enter the decimal number: "); scanf("%d",&num); printf("The octal equivalent is %d\n", Computing::Base::dec_to_oct(num)); }Ouput:
enter the number: 10 The octal equivalent is 12 enter the number: 64 The octal equivalent is 100
| val | a decimal value |