Sunday, September 7, 2008
Convert Binary Number To Decimal (C++)
#include<iostream.h>
#include<Math.h>
void main()
{
int k,i,w,t;
cin>>k;
i=0;
w=0;
while(k>0)
{ t=k%10;
w=w + (t* pow(2,i));
i++;
k=k/10;
}
cout<
<
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment