Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Beginner's Question

Beginner's Question

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jason K Dove
    wrote on last edited by
    #1

    I can't for the life of me figure out the simplest of problems. I am trying to capture the greatest common denominator of two integers and can't seem to get more than garbage for the output. Any algorithmic nudge in the right direction would be most appreciated.

    R 2 Replies Last reply
    0
    • J Jason K Dove

      I can't for the life of me figure out the simplest of problems. I am trying to capture the greatest common denominator of two integers and can't seem to get more than garbage for the output. Any algorithmic nudge in the right direction would be most appreciated.

      R Offline
      R Offline
      Rejeesh
      wrote on last edited by
      #2

      If the code u have written is available, it would be easy to check why is it giving wrong output.:-O void (*p[10]) (void (*)());

      1 Reply Last reply
      0
      • J Jason K Dove

        I can't for the life of me figure out the simplest of problems. I am trying to capture the greatest common denominator of two integers and can't seem to get more than garbage for the output. Any algorithmic nudge in the right direction would be most appreciated.

        R Offline
        R Offline
        Rejeesh
        wrote on last edited by
        #3

        int GCD(int x, int y) { //Swap if x < y if(x < y) { int t = x; x = y; y = t; } while(x%y) { int r = x%y; x =y; y = r; } return y; } void (*p[10]) (void (*)());

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups