C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Correction of a code in question:
// https://www.sololearn.com/Discuss/2909394/?ref=app
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
double reel()
{
// srand( time( NULL ) ); // + moved to main()
double s = rand() % 2 == 0 ? -1 : 1;
return s * sqrt( rand() % 1001 ); // + there was excess ')' on this line
}
typedef struct
{
double x;
double y;
} point;
point RandomPoint()
{
point p = { x : reel(), y : reel() };
return p;
}
int main()
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run