CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

ComputingBase

dec to oct

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.26
sub units 0.00
add a commercial licence to your cart
0
viewed 100 times and licensed 12 times

Converts a decimal number into octal number

Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Interface

#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

Function Documentation

Dec To Oct Calculator
  
Add calculator to website or email
 
intdec_to_octintval )
Converts a Decimal (base 10) number to an Octal (base 8) number.

Octal number only include the representations for the values from 0 to 7, as in
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
Example 1:
#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
Parameters:
vala decimal value
Returns:
a octal value
Authors:
Shankar Raju (September 2006)
Will Bateman (updated Jan 2008)
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 28 Oct 08 @ 09:35     Page Rendered: 2010-03-14 12:57:22

Valid CSS!   Valid XHTML 1.0 Transitional