+ 2
Program for converting decimal number to binary number?
like 3 is given then it should change to 11.
2 Respostas
+ 2
let n is the number
use loop ,of condition n!=0
inside loop {
d=n%2
sum=0
sum=sum*10+d
n=n/2
}
reverse the digits of sum like
use loop ,of condition sum!=0
inside loop {
d=sum%10
print d
sum=sum/10
}
and all the variables are integer data type.
+ 23