Skip to main content

Sum of the series to 25 terms 1+1/4+1/9+.....

PROCEDURE:-

    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  
CODE:-

#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

Popular posts from this blog

Find Value of S=ut+1/2*a*t**2.

PROCEDURE:-        1.enter values for u,a,t to find distance        2.find distance with the formulae ut+1/2at 2        3.print the above result CODE:- #include<stdio.h> #include<conio.h> void main() {   float u,t,a,S;   clrscr();   printf(“enter values u,t,a”);   scanf(“%f %f %f”, &u,&t,&a);   S=(u*t)+(0.5*a*t*t);   printf(“\n  S = %f”, S); } Input:- enter values u,t,a               U=10,t=4,a=4.9 Output:- S =79.200