Check this out:
#include <stdio.h>
#include <math.h>
main()
{
float H,pi;
int n,ni,i,x[1000],y[1000],points;
points=0;
printf("insert ni and n\n");
while(scanf(" %d %d ",&ni,&n) ==2)
{
x[points]=ni;
y[points]=n;
points++; }
pi=0;
H=0;
for(i=0; i<points; i++)
{
pi= pi + x/y;
}
H=-(pi*ln(pi));
printf("The pi is %f,the ln(pi) is %f and the H is %f\n",pi,ln(pi),H);
}
I want to calculate the sum pi*ln(pi).So,can you find me the problem?