PROGRAM TO FIND SUM OF SERIES

No comments
 /*PROGRAM TO FIND SUM OF SERIES */


#include <stdio.h>
  
// Function to return sum of 1/1 + 1/2 + 1/3 + ..+ 1/n
doublesum(intn)
{
  doublei, s = 0.0;
  for(i = 1; i<= n; i++)
      s = s + 1/i;
  returns;
}
  
intmain()
{
    intn = 5;
    printf("Sum is %f", sum(n));
    return0;
}


Output :-


No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀