Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

" ; " after loop



Comment



Test expression



Working with switch case



Header file




Calculate Summation of this series 1 + 22 + 33 + ...... + xx



// 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,res=0,temp; pf("Enter any number: "); scanf("%d",&a); //taking the number to continue loop for(i=1;i<=a;i++) { temp=pow(i,i); //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: %d",res); return 0; }
OUTPUT:


© 2018 - All rights reserved