Closed Thread
Results 1 to 6 of 6

Thread: Pascal

  1. #1
    jen91 is offline Newbie
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Pascal

    Can someone please help me with the code to this programe:

    Make a program that converts a positive integer to its binary form. It is enough that the program is capable of converting a 4 digit number. examples of print: The number 123 in binary form is 111 1011, number 256 in binary form is 1 0000 0000.

    Thanks!

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: Pascal

    Do you know the algorithm for converting decimal to binary?

    What code do you have so far?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    jen91 is offline Newbie
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Re: Pascal

    Quote Originally Posted by WingedPanther View Post
    Do you know the algorithm for converting decimal to binary?

    What code do you have so far?
    I have nothing so far because i don't know what to do, please help me

  5. #4
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: Pascal

    Well, you need to be able to get the number you want to convert from the user.

    Then you need to convert it to binary (I would store it in a string).

    Then you need to output the string.

    These links will help with step 2:
    Binary numeral system - Wikipedia, the free encyclopedia
    Implementation of a base conversion algorithm from Interactive Mathematics Miscellany and Puzzles
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    jen91 is offline Newbie
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    0

    Re: Pascal

    [QUOTE=WingedPanther;122603]Well, you need to be able to get the number you want to convert from the user.

    Then you need to convert it to binary (I would store it in a string).

    Then you need to output the string.


    Thanks, but I really need help with the code

  7. #6
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: Pascal

    I won't give you the solution. Can you get input? Can you produce output?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pascal
    By Hunter100 in forum Pascal and Delphi
    Replies: 13
    Last Post: 02-16-2010, 01:21 PM
  2. GUI in Pascal
    By Davide in forum Pascal and Delphi
    Replies: 7
    Last Post: 01-25-2010, 04:35 AM
  3. Help! Pascal
    By jen91 in forum Pascal and Delphi
    Replies: 1
    Last Post: 02-05-2009, 04:56 PM
  4. Dev Pascal Help
    By Pyreforge in forum Pascal and Delphi
    Replies: 3
    Last Post: 11-16-2008, 07:27 AM
  5. Dev pascal help
    By ragingfear in forum General Programming
    Replies: 3
    Last Post: 11-21-2007, 01:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts