Closed Thread
Results 1 to 8 of 8

Thread: Can any one make me a program

  1. #1
    badchitta is offline Newbie
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0
    this is our activity in school... i dont know anything about this
    i already try but it always have an error...

    can any one make it... here is the problem

    Write a complete C program that will display the highest common factor of two numbers.

    The highest common factor (HCF) of two positive integers a and b is the largest integer that
    divides each of a and b exactly. For example, the HCF of 45 and 30 is 15.

    Here is a form of Euclid's algorithm for finding the HCF of two integers. Let's say we want
    to find the HCF of 36 and 90.

    · Write down the numbers: 36 90

    · ... and also write down their difference: 36 90 54
    · Form a "number chain" by repeatedly writing down the difference between the last
    two numbers, stopping when you get to zero. The last non-zero number is the HCF:

    · 36 90 54 36 18 18 0

    · The HCF of 36 and 90 is 18. (tip: use absolute value)


    Example:
    Input: 30 45
    Output: 15
    use C++ programming..
    Last edited by TkTech; 09-21-2009 at 02:40 PM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

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

    Re: Can any one make me a program

    This looks like homework. What do you have so far?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    Join Date
    Jul 2009
    Location
    Santa Clarita, CA
    Posts
    2,111
    Blog Entries
    47
    Rep Power
    31

    Re: Can any one make me a program

    Quote Originally Posted by badchitta View Post
    i already try but it always have an error...

    can any one make it...
    Can we make it? Yes.
    Will we make it? No.

    The program you're asking for is trivial. You'll need to be familiar with loops, storing data in variables, and using expressions. I'm not sure if you're supposed to program this with C or C++, since in your first post it states "Write a complete C program that..." followed by your second post, stating "use C++ programming..".

    If you've already tried, post what you've done so far. We can help you from there, explain what the problem is, and in that manner you'll learn more about how to solve problems and how to apply that problem-solving to your programs. The point is to teach you how to program, which yes, involves you seeing a lot of other people's code, but more importantly involves you writing code. Get it?
    Wow I changed my sig!

  5. #4
    relapse's Avatar
    relapse is offline Programming Expert
    Join Date
    Jul 2009
    Location
    Intrawebs
    Posts
    479
    Blog Entries
    2
    Rep Power
    0

    Re: Can any one make me a program

    Sure, how much money are you willing to send me to make this?

  6. #5
    Macoder's Avatar
    Macoder is offline Learning Programmer
    Join Date
    Aug 2009
    Posts
    39
    Rep Power
    0

    Re: Can any one make me a program

    Thought it was called greatest common factor... anyways, I have this program already made, but you can't see it until you post what you have so far and let us try to help you. Asking for code isn't going to get you any better at programming.

  7. #6
    orispo is offline Newbie
    Join Date
    Feb 2008
    Location
    new jersey
    Posts
    14
    Blog Entries
    1
    Rep Power
    0

    Re: Can any one make me a program

    macoder is right man u hav to show what uve done cause i also have the code

  8. #7
    cdg10620's Avatar
    cdg10620 is offline Programming Expert
    Join Date
    Jun 2009
    Location
    Texas
    Posts
    387
    Blog Entries
    3
    Rep Power
    12

    Re: Can any one make me a program

    And again...

    Code:
    While( !User.hasAnswer )
    {
         User.askQuestion();
    
         if( User.postCode && User.putForthEffort )
         {
              CodeCallMembers.Help();
              User.hasAnswer = true;
         }
         else
         {
              CodeCallMembers.Laugh();
         }
    }
    -CDG10620
    Software Developer

  9. #8
    Join Date
    Jun 2010
    Posts
    13
    Rep Power
    0

    Re: Can any one make me a program

    Successive substraction algorythm works too.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 08-06-2011, 03:31 AM
  2. [REQ] Programmer to make me a program
    By loldude101 in forum General Programming
    Replies: 2
    Last Post: 07-25-2010, 10:18 AM
  3. [REQ] Programmer to make me a program [REQ]
    By loldude101 in forum Request Services
    Replies: 0
    Last Post: 07-24-2010, 02:11 PM
  4. How do i make a GUI program in C/C++
    By putrapanj. in forum C and C++
    Replies: 1
    Last Post: 01-12-2009, 07:52 AM
  5. How to make program that Steals IP from someone from MSN in VB6
    By ViRuSS in forum Visual Basic Programming
    Replies: 16
    Last Post: 09-02-2008, 01:01 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