C Program to convert binary number to decimal number
#include
#include
#include
void main()
{
int no,rem,d,n=0,sum=0;
clrscr();
printf("\nEnter the binary no:");
scanf("%d",&no);
while(no!=0)
{
rem=no%10;
d=rem*pow(2,n);
n++;
no=no/10;
sum=sum+d;
}
printf("\nThe decimal no is:%d",sum);
getch();
}
************OUTPUT**************
Enter the binary no:1111
The decimal no is:15
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Wednesday, December 31, 2008
C Program to convert binary no in to decimal no
Posted by ars at 11:34 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment