unix script for converting a decimal to binary

Could anybody please help me in writing a script in unix for converting a decimal number to binary number.

Is this homework??

man bc

Cheers
ZB

I tried 'bc' and 'dc'... but I am not convenient with them.. can you provide the solution...

Hmm... benefit of the doubt then....

echo "ibase=10;obase=2;128" | bc

Where 128 is the number you want to convert.

I'll leave it to you to convert this into a versatile script.

Cheers
ZB