Skip to content

Instantly share code, notes, and snippets.

@Mashpy
Created December 14, 2012 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mashpy/4284240 to your computer and use it in GitHub Desktop.
Save Mashpy/4284240 to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main()
{
// আমাদের কাজ হল বাইনাতী থেকে ডেসিমেল এ নিতে হবে।
long int bin_num,bin_tmp,dec_digit,dec_num=0,number_base=0;
printf("enter the binary number");
scanf("%1d", & bin_num);
bin_tmp=bin_num;
while(bin_num)
{
dec_digit=bin_num %10;
dec_num +=dec_digit <<number_base;
number_base+=1;
bin_num /=10;
}
printf("\n Decimal equivalent is %1",dec_num);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment