It does not turn out to describe this example on C++, tried through arrays, but a full porridge was obtained.
p = (1-1 / 22) * (1-1 / 32) … (1-1 / N2)
N = (N & GT; 2).
Answer 1
#include & lt; cmath & gt;
Double F (unsigned int n)
{
IF (N & LT; = 2)
Return -1.0;
Double Value = 1;
For (unsigned int i = 2; i & lt; = n; i ++)
{
Value * = (1 - 1 / POW (I, 2));
}
RETURN VALUE;
}
INT MAIN ()
{
For (unsigned int i = 2; i & lt; 100; i ++)
PrintF ("% 1.9f \ n", f (i));
}