English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

Well, you could just crank it out by brute force...

double result1 = 0;
double result2 = 0;
for(double x = 1; x <= n; x+=1){
  result1 += 1.0/x;
  result2 += 1.0 / ( x*x);
}

2007-12-28 22:55:07 · answer #1 · answered by jgoulden 7 · 0 0

Oh, Dondi, you're a devil with words. you relatively be attentive to the thank you to make the ladies cry. i think of possibly some adult males too, however the macho varieties could in no way admit it. alluring. that's no ask your self you're so enjoyed.

2016-10-20 06:27:14 · answer #2 · answered by bobbee 4 · 0 0

a)
double result = 0;
result += 1.0/((x*(x+1))/2);

b)
double result = 0;
for(double x = 1; x <= n; x+=1)
{
result += 1.0 / ( 2^x);
}

2007-12-29 02:28:52 · answer #3 · answered by MGohara 2 · 0 0

fedest.com, questions and answers