I m doing thread programming and trying to implement MonteCarlo technique for calculating Pi value in it. I compiled the code and I have no error but when I execute I get no output for it. Kindly correct me if there's any mistake.
Here's my code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
#define frand() ((double) rand() / (RAND_MAX))
#define MAX_LEN 1353
const size_t N = 4;
float circlePoints=0;
void* point_counter(void *param){
    float xcord; 
    float ycord; 
    while(MAX_LEN){
        xcord=frand();
        ycord=frand();
        float cord = (xcord*xcord) + (ycord*ycord);
        if(cord <= 1){
            circlePoints++;}
    }
}
int main()
{
    printf("out");
    size_t i;
    pthread_t thread[N];
    srand(time(NULL));
    for( i=0;i <4;++i){
        printf("in creating thread");
        pthread_create( &thread[i], NULL, &point_counter, NULL);
    }
    for(i=0;i <4;++i){
        printf("in joining thread");
        pthread_join( thread[i], NULL );
    }
    for( i=0;i <4;++i){
        printf("in last thread");
        float pi = 4.0 * (float)circlePoints /MAX_LEN;
        printf("pi is %2.4f: \n", pi);
    }
    return 0;
}
 
     
     
     
    