Hey gang ,
I have a c program to calculate sin of a no using exp series (DSP
assigmment :)).It compile properly and then dumps core. When I use gdb to
analyse the core Gdb dumps core!!!.
Any sugeestions?
-rohit
Program listing:
#include <stdio.h>
void main (void)
{
float mysin(float x);
float no,finalval;
printf("Enter no\n");
scanf("%f",&no);
finalval=mysin(no);
printf("answer is %f",finalval);
}
float mysin(float x)
{
float sum,term,value;
int i;
term=x;
sum=x;
i=1;
while (i<=10)
{
value=((-1)*term*x*x)/((i+1)*(i+2));
sum=sum+value;
i=i+2;
term=value;
}
return(value);
}
To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the mailing list
button and fill the appropriate information
and submit. For any other queries contact the ML maintener