Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C: e^(n+1)!

Name: Anonymous 2009-11-28 17:54

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double factorial(double l)
{
    double fact = 1;
    while (l>1)
    {
        fact=fact*l;
        l=l-1;
    }
    return fact;
}
int main()
{
    double f2,e,f,l,n;
    n=exp(5);
    e=0;
    printf("exp(5)=%4.5f\n\n",n);
    for(l=1;l<7;l++)
    {
        f=factorial(l);
        f2=pow(f,l);
        e=e+(f2/f);
    }
    e=e++;
    printf("e^(n+1)!=%.f\n\n",e);
    system("pause");
    return 0;
}
I should see this - 1.934917
I see this - 193491763...

Name: Anonymous 2009-11-28 18:16

bamp

Name: Anonymous 2009-11-28 18:25

sage

Name: Anonymous 2009-11-28 18:58

printf("-1")
I simplified you're program.

Name: Anonymous 2009-11-28 19:42

    system("pause");
IHBT

Name: Anonymous 2010-12-10 8:22

Don't change these.
Name: Email:
Entire Thread Thread List