Friday, 24 June 2016

 

C Programme to convert Binary to Decimal 

Source Code:
#include<conio.h> 
#include<stdio.h> 
#include<math.h> 
int main() 

{  
int num,i=0,j,a,r=0;  
printf("\nEnter binary number");  
scanf("%d",&num);  
while(num!=0)  
{   
a=num%10;   
num=num/10;   
r=r+a*pow(2,i);   
i++;  
}  
printf("\nDecimal number is:%d",r); 
}

0 comments:

Post a Comment

Have A Wonderful Day !

  • WE LOVE YOU ALL

    WE LOVE YOU ALL

      The user is always at the heart of the strategy.
  • MULTI-CULTI

    MULTI-CULTI

      There are 3 different languages spoken in our office.
  • COFFEE INTAKE

    COFFEE INTAKE

      Number of coffees consumed per hour on any given day.
  • WORKAHOLICS

    WORKAHOLICS

      The amount of time spent in the office, six days a week.

--------------------------------------------------------------------

Word Of The Day | Learn And Use A New Word Everyday!

--------------------------------------------------------------------

"Insidious"

Working or spreading in a hidden and usually injurious way

"glaucoma is an insidious disease"

Copyright © 2016 Engineers Burger - All Rights Reserved. Digital Craftmanship - Nikhil Jha and Jay Akbari.
Templateism MyBloggerLab.com