Number System
There are 4 number systems:
When we want to convert a decimal number to any number system then we divide the number by particular base number.
When we want to convert from any number system to decimal number system then we multiply each digit of the number with the increasing powers of the base number and add all terms.
ReplyDeletepublic class numberSystem
{
public int dec2bin(int n)
{
if(n==1)
return 1;
else
return dec2bin(n/2)*10+n%2;
}
}