I'm having problem writing code for a program that estimates the value of the mathematical constant e by using this formula e= 1 + 1/1! + 1/2!...
I just cant get this to work. Can someone please help
ellas747 0 Newbie Poster
Recommended Answers
Jump to PostHmm ... start by writing a recurisve function to find the factorial of a number. There's a tutorial on recursion in either the C++ or the Computer Science section of this site - I forget which. You should also be able to find this function by doing a quick google …
Jump to PostSince this is not a for-hire service, I think it's good that we watch over each other, but code snippets should be seen as starting points or suggestions, not finished product. None of the snippets or suggestions I make are ones I've built and tested, only ideas to get the …
Jump to PostI've been playing along at home; any criticisms for this?
#include <stdio.h> #include <math.h> #include <float.h> #include <limits.h> int factorial(unsigned long n, unsigned long *result) { unsigned long i; for ( *result = 1, i = 2; i <= n; i++ ) { if ( *result > …
Jump to Post>>any criticisms for this?
>You code looks a lot like C
It is.>but you use the single line comment style without mentioning C99. ;)
True enough. I came back to edit that debug line out, but chose not to.>Other than that I have no criticisms except …
Jump to Post"I have very little time to devote to posts despite what you may think, but I still manage to check my answers. Thus I have very little patience for people who are either too lazy or too arrogant to make sure that they're right."
Hee hee. Well, I'm both …
All 20 Replies
Dani 4,675 The Queen of DaniWeb Administrator Featured Poster Premium Member
ellas747 0 Newbie Poster
ellas747 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
ZuK 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
ZuK 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
ZuK 0 Light Poster
Chainsaw 12 Posting Pro in Training
Narue 5,707 Bad Cop Team Colleague
ZuK 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
ZuK 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
Dave Sinkula 2,398 long time no c Team Colleague
Narue 5,707 Bad Cop Team Colleague
Dave Sinkula 2,398 long time no c Team Colleague
Chainsaw 12 Posting Pro in Training
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.