NO

Author Topic: Need Help Please  (Read 2916 times)

Ali

  • Guest
Need Help Please
« on: September 30, 2004, 02:58:18 am »
I wrote this program it's ment to calculate the suqar root of number form 1-10 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;
}

Ngan Lo

  • Guest
Need Help Please
« Reply #1 on: September 30, 2004, 06:53:56 am »
Code: [Select]
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;
}