C program to sum the series 1/12+1/22+1/32
#include <stdio.h> #include <math.h> #include <conio.h> main() { int number; float sum=0.0, num1, num2; clrscr(); printf("\n Enter the value of n: "); scanf(" %d", &number); for(num2=1.0;num2<=number;num2++) { num1=1/pow (num2,2); sum = sum +num1; } printf("\n The sum of series 1/12 + 1/ 22 +....1/n2 = %f", sum); return 0; }