Hi, this is sreelatha give a c progrm to convert decimal to binary....
thank u....
We don't handout boiler plate code for you. You have to do your own homework
but when you're stuck we're very willing to help you. Please show us what
you've done sofar.
Hi, this is sreelatha give a c progrm to convert decimal to binary....
thank u....
Here is the logic of decimal to binary convertion;
//before looping, after entering the decimal number
x=0;
quotient=DecNum/2;
remainder[x]=Decnum%2; // This is the initial binary number
//Inside loop
x++;
quotient=quotie nt/2;
remainder[x]=quotient%2;
// The loop will end if the value of the quotient will become <=1,
after the loop ends, you will have to reverse the order of remainder[x]
and display it.
Comment