Another Solution for Binary to Decimal:
SOURCE CODE:
#include stdio(.)h
#include conio(.)h
void showbits(int h)
{
if(h==1)
printf("%d",h);
else
{
showbits(h/2);
printf("%d",h%2);
}
}
main()
{
int num;
void showbits(int h);
printf("BINARY : ");
scanf("%d",&num);
printf("\nBinary of %d equivalent to decimal is ",num);
showbits(num);
getch();
}
Binary to decimal
Posted in
binary to decimal,
C Plus Plus,
CProg2
Posted by
michel
on Saturday, July 18, 2009
at
3:40:00 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment