Code:

#include <stdio.h>
#include <math.h>
/* main returns int */
void main(void)
{
/* counters should start with 0 in c*/
int i=1;
double single;
double sum=1.0;
/* should let .000001 be a #define
while ( fabs(single>0.000001) ) {
if (i%2==1)
/* should be single = -1.0/(2.0*i+1.0);
What you have does integer division so you get
single = 0 each time.
*/
single=-1/(2*i+1);
else
/* also needs to be changed */
single=1/(2*i+1);
sum+=single;
i++;
}
printf("the sum is converges to %lf \n", sum);
/* return 0 */
}