Skip to content

Instantly share code, notes, and snippets.

@erenkeskin
Created December 26, 2017 08:48
Show Gist options
  • Save erenkeskin/adb3353092c3394d1c5217a05540f2d9 to your computer and use it in GitHub Desktop.
Save erenkeskin/adb3353092c3394d1c5217a05540f2d9 to your computer and use it in GitHub Desktop.
#include<stdio.h>
long int bcd2dec(int binary_sayi);
int main(){
// Ornek Kullanim
int decimal_sayi = bcd2dec(69);
printf("%d\n", decimal_sayi);
return 0;
}
// 2 basamakli sayilar icin
long int bcd2dec(int binary_sayi)
{
return (binary_sayi >> 4) * 10 + (binary_sayi & 0xF);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment