#include <conio.h>
#include <stdio.h>
floattong(int n)
{
int i;
floats=0;
for(i=1;i<=n;i++)
s+=1.0/i;
return s;
}
voidmain()
{
int n;
printf("\nNhap N= ");
scanf("%d",&n);
printf("\n Tong s = %f",tong(n));
getch();
}
No comments:
Post a Comment