0
How do I make a C program that converts decimal numbers in binary?
I can't figure out how to do it. From what I know I must use the do-while cycle.
2 ответов
+ 1
If you know how to make the conversion using a pen and a paper,
make the program do the same thing, the same steps you do.
0
initialize s=0 and n=decimal number.
Main logic behind conversion:
while(n>0){
m=n%2;
n=n/2;
s=s*10+m;
}