Advertisement
Endrerl

sss

Feb 26th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.16 KB | None | 0 0
  1. int DecimalToBCD(int Decimal) {
  2.     return (((Decimal / 10) << 4) | (Decimal % 10));
  3. }
  4.  
  5. int BCDToDecimal(int BCD) {
  6.     return (((BCD >> 4) * 10) + (BCD & 0xF));
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement