A home assignment. C language
Oh my word! Coding that did take a while. The logic however, is quite simple. Recall the number system.


First, determine the length of the number entered by the user. You can do so by dividing the number repeatedly by 10 until the quotient becomes zero.
Then, the maximum value of a digit in decimal number system is 9. So compare each digit in the number with 9. The modulo division operation comes handy in here. See if there's a match. If there's no match go to the next smaller digit, 8 and continue this until you get to zero.
Multiply the first match found using this procedure with 10^(length-1) i.e. you are making it your most significant digit (number systems)
Reduce the length length-- 
Continue this procedure until length becomes zero
A little tip for efficiency, note down the matched digit each time and make that the slab for comparing the remaining digits in the number i.e. if you found out 5 is the first match, and thus the greatest digit found in your number, there's no point starting your comparisons from 9 again for the next digit. Start at 5. Don't be overly smart and start at 4 though. Remember there can be multiple 5's in a number. 


I wrote a working piece of code for this. So this algorithm works. Hope that helps. Ways to improvise the performance are appreciated. However, don't suggest the usage of arrays or strings as they are forbidden in the question.