Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>bcd() convert number to binary coded decimal</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 bcd()                   Convert Number to Binary Coded Decimal

 include <bcd.h>

 bcd  bcd(x);      or      bcd(x, decimals);
 int x;                    double x;
 double x;                 int decimals;

  The bcd() function converts a number to binary-coded decimal form.

   -------------------------------- Example ---------------------------------

 #include <iostream.h>
 #include <bcd.h>

 double x = 12345.678
 bcd a = bcd(x/9,2);         // one ninth of x, rounded to two places




Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson