Program: Write a C program that numerically sums up the infinite series: \(1 + \frac{1}{2^{2}}\frac{1}{3^{2}}\frac{1}{4^{2}}+...\) This is what I have so far, but its not working:
#include #include int main(){float i,n;float sum=0.0;printf("Enter the number of iterations =");scanf("%d", &n);for (i=1;i<=n;i++)sum= sum + 1/(i^(2));printf("The sum of the series is= %f.\n", sum);return 0;}
It must compile with no errors and follow the directions.