You are on page 1of 1

10

95funNSNSN+1
qq
2 3 4 N+1
SN= + + ++
1 2 3 N
q50.049.394948

Modi1.c

#include <stdio.h>
double fun( double q )
{ int n; double s,t;
n = 2;
s = 2.0;
while (s<=q)
{
t=s;
/************found************/
s=s+(n+1)/n;
n++;
}
printf("n=%d\n",n);
/************found************/
return s;
}
main ( )
{
printf("%f\n", fun(50));
}

You might also like