gcd,prime number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 206111344
    New Member
    • Mar 2008
    • 2

    gcd,prime number

    how can i find GCM using C++ language??
    how can i find if the integer is a prime number or not??

    if you can write both programmes
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

    Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

    Then when you are ready post a new question in this thread.

    MODERATOR

    Comment

    • 206111344
      New Member
      • Mar 2008
      • 2

      #3
      i know how to write the programe but i need the formola(functio n)of GCD,and how i can know if it is a prime number or not??



      Originally posted by sicarie
      The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

      Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

      Then when you are ready post a new question in this thread.

      MODERATOR

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        GCD formulas shoudl be in an algebra book.

        The definition of a prime number is that its only factors are itself and one. What else can be said?

        Comment

        • Ganon11
          Recognized Expert Specialist
          • Oct 2006
          • 3651

          #5
          Please don't use more than one thread for your question. It doesn't speed up your answer, and it doesn't increase the accuracy/helpfulness of the answer; all it does is confuse people that would normally be helping you. If all the posts on a topic are in one thread, it is much easier for anyone to see what progress you have made and, thus, give relevant help.

          MODERATOR

          Comment

          • fual
            New Member
            • Feb 2008
            • 28

            #6
            How hard is it to type "primality test"? Not very I've done it for you... http://en.wikipedia.org/wiki/Primality_test
            Originally posted by http://en.wikipedia.or g
            The simplest primality test is as follows: Given an input number n, we see if any integer m from 2 to n − 1 divides n. If n is divisible by any m then n is composite, otherwise it is prime.

            Comment

            Working...