Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Header file



Test expression



Comment



Specifer



Working with switch case




Calculate Summation of this series 1/22 + 1/33 + ...... + 1/(x+1)(x+1)



// AHF C PROGRAM SOLVING

//solving here ITERATIVES STATEMENTS type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int i,a; float res=0.0,temp; //taking the number to continue loop pf("Enter any number: "); scanf("%d",&a); for(i=1;i<=a;i++) { temp=1/pow((i+1),(i+1)); //calculating as given in the series and assigning temp res+=temp; //value of the temp is adding with res variable } pf("\nThe summation of the series is: %f",res); return 0; }
OUTPUT:


© 2018 - All rights reserved