+ 2

Program for converting decimal number to binary number?

like 3 is given then it should change to 11.

1st May 2017, 3:52 PM
Krishna Sai Desaboina
Krishna Sai Desaboina - avatar
2 odpowiedzi
+ 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.
1st May 2017, 4:04 PM
Krishna Sai Desaboina
Krishna Sai Desaboina - avatar
1st May 2017, 3:54 PM
Dev
Dev - avatar