PROCEDURE:-
#include<stdio.h>
void main()
{
int i;
float sum=0;
for(i=1;i<=25;i++)
sum=sum+(1.0/(i * i));
printf(“ sum of the series is = %f”,sum);
}|
Output:- sum of the series is =1.605724
- 1.set sum to 0 and set i to 1
- 2.repeat step 3 until i less than or equal 25 incrementing i by 1
- 3.set sum=sum+1/square(i)
- 4.print sum
#include<stdio.h>
void main()
{
int i;
float sum=0;
for(i=1;i<=25;i++)
sum=sum+(1.0/(i * i));
printf(“ sum of the series is = %f”,sum);
}|
Output:- sum of the series is =1.605724
Comments
Post a Comment