## Problem :: Write a program to determine and print the sum of the following harmonic series for a given value of n.
## Solution ::
##Write down headers yourself.
void main()
{
int a,b,n;
float s;
clrscr();
printf("Enter n=");
scanf("%d",&n);
printf(" 1");
for(a=2;a<=n;a++)
{
printf(" +");
printf("1/%d",a);
}
for(b=0;b<=n;b++)
{
s=1+ 1/(1+ (float) (b));
}
printf("= %f",s);
getch();
}
2_1_Harmonik Series for a Given Vlue of n
Posted by Bijon Labels: balaguru solutions, c solutions 2.1
Subscribe to:
Post Comments (Atom)


0 comments
Post a Comment