Hey guys Here is my code (it is a function as usual with my crap)
As you can see this creates a file with 3 columns of numbers, I am trying to get the numbers under 200 (or any number set that I want) that equation above is suppose to keep them above 0 and less then too but it does is keep the numbers under 200, and it can be way under like -18921341243, How do I make each of these arrays be between 0 and 200 or 1 and 200?Code:void fPlanes(FILE *Fplanes) { /*declaring arrays, I am going to use int to keep everything standard */ int aXaxis[50]; int aYaxis[50]; int aZaxis[50]; int q = 0; aXaxis[50] = (int)(((double)rand())/((double)(RAND_MAX)+(double)(1)))*200; aYaxis[50] = (int)(((double)rand())/((double)(RAND_MAX)+(double)(1)))*200; aZaxis[50] = (int)(((double)rand())/((double)(RAND_MAX)+(double)(1)))*200; for(q=0; q < 50; q++) { fprintf(Fplanes, "%i %i %i \n", aXaxis[q], aYaxis[q], aZaxis[q]); } }
I know my syntax is right.