Home > C Programming > Decimal to Biner with C
Decimal to Biner with C
Posted on Minggu, 11 Oktober 2009 by gero
/* 32 bit for negative */
#include< stdio.h > /* dont forget to delete space */
int binary(int a){
if(a>1){binary(a/2);}
printf("%d",a%2);
}
int main()
{ int in;
printf("Insert Decimal : ");
scanf("%d",&in);
if(in<0){in+=2147483647;in++;}
binary(in);
getchar();getchar();
return 0;
}
Category Article C Programming
Diberdayakan oleh Blogger.