include stdio include stdlib run this program using the console pauser

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int n,i;
double s;
printf("n=");
scanf("%d",&n);
for (i=1,s=1;i<=n;i++)
s*=1+(1/i*i);
printf("s=%lf",s);
return 0;
}