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. C

C

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
4 Posts 4 Posters 4 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.
  • C Offline
    C Offline
    Christine Belisario
    wrote on last edited by
    #1

    #include

    int getFactorial(int);

    int main(void) {
    int n;
    printf("Enter n: ");
    scanf("%d",&n);

    printf("Factorial of %d is %d", n, getFactorial(n));
    
    return 0;
    

    }

    int getFactorial(int n) {
    // how to Implement this recursive function
    }

    L R 2 Replies Last reply
    0
    • C Christine Belisario

      #include

      int getFactorial(int);

      int main(void) {
      int n;
      printf("Enter n: ");
      scanf("%d",&n);

      printf("Factorial of %d is %d", n, getFactorial(n));
      
      return 0;
      

      }

      int getFactorial(int n) {
      // how to Implement this recursive function
      }

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Christine Belisario wrote:

      // how to Implement this recursive function

      Google will find you many explanations of the factorial function. You just need to think about how you could implement it in code.

      1 Reply Last reply
      0
      • C Christine Belisario

        #include

        int getFactorial(int);

        int main(void) {
        int n;
        printf("Enter n: ");
        scanf("%d",&n);

        printf("Factorial of %d is %d", n, getFactorial(n));
        
        return 0;
        

        }

        int getFactorial(int n) {
        // how to Implement this recursive function
        }

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

        When you've got a plank of code like this, and haven't necessarily begun stepping a mast of methods by leafing through your function library, presumeably squirreled away in the hold in a rat-free database, sometimes it's best to just go to a search engine that's got three sheets to the wind (open to the public), type in each word grain separated by commas and hammer the return. And marking the returns using your favorites folder by hanging the list of code fragments off the hook of the internet browser you're buckling, for future reference, you're well on your way to driving the sea with your bark of ... lively functions ... and saving CP from a dumb trend which is hopefully on it's way south.

        Greg UtasG 1 Reply Last reply
        0
        • R RedDk

          When you've got a plank of code like this, and haven't necessarily begun stepping a mast of methods by leafing through your function library, presumeably squirreled away in the hold in a rat-free database, sometimes it's best to just go to a search engine that's got three sheets to the wind (open to the public), type in each word grain separated by commas and hammer the return. And marking the returns using your favorites folder by hanging the list of code fragments off the hook of the internet browser you're buckling, for future reference, you're well on your way to driving the sea with your bark of ... lively functions ... and saving CP from a dumb trend which is hopefully on it's way south.

          Greg UtasG Offline
          Greg UtasG Offline
          Greg Utas
          wrote on last edited by
          #4

          Prize winner for metaphor density. :-D

          Robust Services Core | Software Techniques for Lemmings | Articles
          The fox knows many things, but the hedgehog knows one big thing.

          <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
          <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

          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