C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 27th, 2004, 08:04 PM
Valerie1969 Valerie1969 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 Valerie1969 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy code for converting an integer into binary form

Hello all, I am in an intro C++ class and in my program I have to have someone choose a number between 0-255. The number plus the binary form of that number has to show on the screen. Can someone help me? Thankyou!

Reply With Quote
  #2  
Old October 27th, 2004, 08:20 PM
DaWei_M's Avatar
DaWei_M DaWei_M is offline
Lord of Dorkness
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Jan 2004
Location: Central New York. Texan via Arizona, out of his element!
Posts: 8,515 DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level)DaWei_M User rank is General 34th Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Weeks 18 h 59 m 31 sec
Warnings Level: 20
Number of bans: 3
Reputation Power: 3268
What have they taught you so far? Try to apply it, present some code when you have problems. We're more than happy to help in that way. We have a deal with instructors - if we provide the answer, we get the grade.
__________________
Functionality rules and clarity matters; if you can work a little elegance in there, you're stylin'.
If you can't spell "u", "ur", and "ne1", why would I hire you? 300 baud modem? Forget I mentioned it.
DaWei on Pointers Politically Incorrect.

Reply With Quote
  #3  
Old October 28th, 2004, 06:10 AM
nnxion's Avatar
nnxion nnxion is offline
Last Day: May 29, 2005
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2004
Location: elemental sphere
Posts: 742 nnxion User rank is Lance Corporal (50 - 100 Reputation Level)nnxion User rank is Lance Corporal (50 - 100 Reputation Level)nnxion User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 Days 7 h 20 m 20 sec
Reputation Power: 9
convert your number to binary then print it, it's that simple

it seems to me you could do something like this:
Code:
cout << number;
cout << binary;

Reply With Quote
  #4  
Old October 28th, 2004, 01:20 PM
Valerie1969 Valerie1969 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 Valerie1969 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile

I got it but thankyou for the help

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > code for converting an integer into binary form

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap