#include
#include conio (.) h
using namespace std;
int bintodec(int decimal)
{
int total = 0;
int power = 1;
while(decimal > 0)
{
total += decimal % 10 * power;
decimal = decimal / 10;
power = power * 2;
}
return total;
}
main()
{
int num;
cout << "Enter decimal: "; cin >> num;
cout <<>
getch();
}
0 comments:
Post a Comment