hi. i need help. i have a program that generate a number between -1 and 1 for 10,000 times. it is in a function. now i need to write another function so that for every number generated, i find the arcsine of it and get the output by 90 degrees. i've been up all night programming and now i came to this and i feel like sh*t. pls give me some help. my brain is not thinking anymore maybe you can help me out pls. very desperate. 10x ppl
CODE
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <math.h>
#define SIZE 100
int random_no (float x);
int partD (float y);
int main (void)
{
float num;
float y;
int array1[101][181] = {{0},{0}};
partD (y);
return (0);
}
int random_no (float x)
{
int i;
srand (time(NULL));
for (i=0; i<10000; i++)
{
x = ((float)rand() / (RAND_MAX) * 2 ) -1;
printf ("%d. %f\n",i+1, x);
}
return (x);
}
int partD (float y)
{
int i;
// this right here.... i need to fix this!! must get it working! :@
random_no (y);
y = 1/(sin(y));
printf ("%f\n", y);
return (y);
}