View Single Post
  #1   Spotlight this post!  
Unread 15-04-2008, 12:50
berkanbaba berkanbaba is offline
Registered User
no team
 
Join Date: Apr 2008
Location: turkey
Posts: 6
berkanbaba is infamous around these partsberkanbaba is infamous around these partsberkanbaba is infamous around these parts
Exclamation C Programming Homework Help Needed

i have a question about c programming.can you help for the solution.thank you . i just use C not C++


Question:
Write a C program for a binary notation simulator for positive integer numbers. Your program will ask and get positive integer numbers from user. Program will stop asking new numbers if 0 is input. It will display the binary representation of the input number and the minimum number of digits required to represent that number as given in the sample run.


Sample Run: (Italic and bold letters indicate the user input)
Enter a positive integer: -5
Enter a positive integer: -3
Enter a positive integer: 5
It is 101. At least 3 digits required.
Enter a positive integer: -2
Enter a positive integer: 7
It is 111. At least 3 digits required.
Enter a positive integer: 0
Stop... Bye..