Code for Program to calculate sum of terms of 1/n i.e. 1/n + 2/n + 3/n and so on till n/n in C Programming
#include<stdio.h>
#include<conio.h>
void main()
{
float sum,n,term;
int count = 1;
clrscr();
sum = 0;
printf("Enter value of n\n");
scanf("%f",&n);
term = 1.0/n;
while(count<=n)
{
sum = sum + term;
count++;
}
printf("Sum = %f\n",sum);
getch();
}