Pelles C forum
Pelles C => General discussions => Topic started by: Ali on September 30, 2004, 02:58:18 AM

I wrote this program it's ment to calculate the suqar root of number form 110 and store it in the array but i can'nt seem to make it work.
#include <stdio.h>
#include <math.h>
#define SIZE 10
int main()
{
double x[SIZE];
//double r;
int i;
for (i=1; i<=SIZE; i++)
{
x[] = sqrt (x) ;
printf("%lf\n",x[SIZE] );
}
return 0;
}

int main(void)
{
double x[SIZE];
//double r;
int i;
for (i=0; i<SIZE; i++)
{
x[i] = sqrt (i+1) ;
printf("%lf\n",x[i] );
}
return 0;
}