1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need help with recursion

Discussion in 'C' started by sa819, Dec 11, 2007.

  1. sa819

    sa819 New Member

    Joined:
    Dec 11, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Is there any way to use recursion in C to calculate the factorials of numbers above 15?
    I made a simple program but it can calculate the values satisfactorily only for numbers from one to fifteen.
     
  2. Salem

    Salem New Member

    Joined:
    Nov 15, 2007
    Messages:
    133
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Please don't PM me for 1:1 support.
    1. Post your code.

    2. Don't forget the code tags, ie [code][/code] placed around your code.

    3. 16! = 20922789888000. Depending on your data types (int, long, float, double), you could well be experiencing either numeric overflow, or loss of precision. Coping with either of them is no easy task.
     

Share This Page