View Single Post
  #5   Spotlight this post!  
Unread 15-04-2008, 14:19
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,277
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: C Programming Homework Help Needed

An easy way to go from decimal to binary.

Psuedo Code
Quote:
While number>0
push a bit equal to (number mod 2) onto the end of the binary number
divide (number-(number mod 2)) by 2
end while
that should get you started, as a couple of hints, if all you are doing is printing out the number you may not need the array, also c truncates numbers when you do integer math, this simplifies the loop slightly.

See what you can figure out and feel free to ask for help
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)