hi
having an irritating problem. i've tried everything i know, still, cant figue why its not working..
the program should get from you a "n" value, and calculate the deniz function as clearly be seen...
Need a little help please..
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
long deniz ( double x);
int main(void)
{
int i;
int n;
long total = 0;
printf (" n value ?? \n");
scanf ( "%d", &n );
for ( i = 1;i <= n; ++i )
{ total = total + deniz(i);
}
printf( "output %f", total);
system("PAUSE");
return 0;
}
long deniz (double x)
{
return log(x)-x ;
}