0

HI can anyone help me to write this programe in c
Q ; WRITE A PROGRAM TO DETERMINE AND PRINT THE SUM OF THE FOLLOWING HARMONIC SERIES FOR A GIVEN VALUE OF N;
1+1/2+1/3+14+....................1/N
THE VALUE SHOULD BE GIVEN INTERACTIVELY THROUGH THE TERMINAL

4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by nirav99
0

can you please help me by elaborating this.i mean with full program

-1

hi..

#include<stdio.h>
#include<conio.h>

void main()
{
	int n,i;
	clrscr();
	printf("Enter N:- ");
	scanf("%d",&n);
	for(i=1;i<n;i++)
	{
		printf("1/%d  +  ",i);
	}
	printf("1/%d",i);
	getch();
}

you can only print this series..
but if you want series with answer..
than you just have to add one equation in loop.. sum=sum+(1/i); at last print this sum...
okay

Edited by nirav99: spelling mistake

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.