jituTechnology

jituTechnology

write a program to find the sum of series 1/1 + ½ + 1/3 + 1/n+….

Here is the c source code/program for: write a program to find the sum of series 1/1 + ½ + 1/3 + 1/n+….

/*program to find the sum of series.*/
#include <stdio.h>
#include <conio.h>
void main ()
{
     float i,n;
   float sum =0;
   printf (“enter the terms = “);
   scanf (“%f”,&n);
   for (i=1;i<=n;i++)
   {
     sum += 1/i;
   }
   printf (“sum=%f\n”,sum);
   getch();
}

 

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

April 2026
S M T W T F S
 1234
567891011
12131415161718
19202122232425
2627282930