# Conversion of decimal to binary in C programming n store in arrays



## Zenoba (Oct 1, 2008)

Can someone give me an idea to convert decimal numbers into its binary equivalent and store each binary in *arrays* in *C programming* language??


----------



## mt2002 (Sep 14, 2005)

By default all integers are already stored as binary numbers, so to obtain each bit just use a bit mask. (This assumes the integer is stored as a data type int)


----------



## IMM (Feb 1, 2002)

I am also unclear as to what you want.
If you want to convert the number to a array of strings for printing -- most C and Cpp compilers have an _itoa_ extension of some form (usually several of 'em for different input types) to perform the conversion to string.
For binary - the radix is 2
see - http://en.wikipedia.org/wiki/Itoa


----------

