#include<stdio.h>
int main()
{
int
n,
k;
float sum=0;
printf("Enter the value of n: ");
scanf("%d",&n);
for(k=1;k<=n;k++)
sum=
sum +
(float)1/k;
printf("\nSum= %f",sum);
return
0;
}
|
No comments:
Post a Comment