Created
December 26, 2017 08:46
-
-
Save erenkeskin/d72fdcf96426f1b235453513e71101ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int dec2bcd(int decimal_sayi); | |
int main(){ | |
// Ornek Kullanim | |
int binary_sayi = dec2bcd(45); | |
printf("%d\n", binary_sayi); | |
return 0; | |
} | |
// 2 basamakli sayilar icin | |
int dec2bcd(int decimal_sayi) | |
{ | |
return (((decimal_sayi / 10) << 4) | (decimal_sayi % 10)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment