The problem is to print the obtained remainders in the reverse order which implies that you'll have to store some sort of information abt what remainders you obtained in the previous step.
One way to do it is to use a character array as such:
char convert = "01"; Then you can use the remainder obtained as the index to the above string and store the resulting character in another array for later display.
The advantage of the above logic is that you can easily extend your code to make it convert to octal or hexadecimal just by doing:
char convert="0123456789ABCDEF" . There recently was a thread which had this program. You can take a look at that.
Another way is to have a multiplier to multiply your obtained remainder with.
code snippet:
while(num>0)
{
temp = num%2; //obtain 0 or 1
temp = mul * temp;// multiply with 1 or 10 or 100...
sum+= temp; // sum holds the final value
mul*=10; // modify mul and num for the next iteration
num/=2;
}