#include <stdio.h>
#include <conio.h>
void main()
{
int n;
printf("nhap n ");
scanf("%d", &n);
int i = 2;
float s = 1;
float a = 1;
int b = 1;
while(i<=n)
{
a = a + i;
b = b*(-1);
s = s + b/a;
i = i + 1;
}
printf(" Tong La : %f\n", s);
}
#include <conio.h>
void main()
{
int n;
printf("nhap n ");
scanf("%d", &n);
int i = 2;
float s = 1;
float a = 1;
int b = 1;
while(i<=n)
{
a = a + i;
b = b*(-1);
s = s + b/a;
i = i + 1;
}
printf(" Tong La : %f\n", s);
}
Comment