 given is the following:

Write a program to discover the answer to this puzzle:"Let's say men and women are paid equally (from the same uniform distribution). If women date randomly and marry the first man with a higher salary, what fraction of the population will get married?"

From this site
My issue is that it seems that the percent married figure I am getting is wrong. Another poster asked this same question on the programmers exchange before, and the percentage getting married should be ~68%. However, I am getting closer to 75% (with a lot of variance). If anyone can take a look and let me know where I went wrong, I would be very grateful.
I realize, looking at the other question that was on the programmers exchange, that this is not the most efficient way to solve the problem. However, I would like to solve the problem in this manner before using more efficient approaches.
My code is below, the bulk of the problem is "solved" in the test function:
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define ARRAY_SIZE 100
#define MARRIED 1
#define SINGLE 0
#define MAX_SALARY 1000000

bool arrayContains(int* array, int val);
int test();

int main()
{
    printf("Trial count: ");
    int trials = GetInt();

    int sum = 0;
    for(int i = 0; i < trials; i++)
    {
        sum += test();
    }

    int average = (sum/trials) * 100;

    printf("Approximately %d %% of the population will get married\n", average / ARRAY_SIZE);
}

int test()
{
    srand(time(NULL));

    int femArray[ARRAY_SIZE][2];    
    int maleArray[ARRAY_SIZE][2];

    // load up random numbers   
    for (int i = 0; i < ARRAY_SIZE; i++)
    {
        femArray[i][0] = (rand() % MAX_SALARY);
        femArray[i][1] = SINGLE;

        maleArray[i][0] = (rand() % MAX_SALARY
given is the following: 

 Write a program to fall upon the solution to this puzzle:"Let's say men and charwoman are give equally (from the same undifferentiated distribution). If womanhood date randomly and marry the inaugural man with a higher wage, what fraction of the population will get married? " 

 From this site 
 My issue is that it seems that the percentage married figure I am experience is improper. Another poster asked this same question on the programmer exchange before, and the share getting married should be ~68% . However, I am get closer to 75% (with a draw of variance). If anyone can take a look and lease me know where I went wrong, I would be very grateful. 
 I realize, looking at the other question that was on the programmers exchange, that this is not the most efficient way to solve the problem. However, I would like to solve the problem in this manner before use more efficient approaches. 
 My code is under, the majority of the trouble is " solved " in the test function: 
 # include < cs50.h > 
 # include < stdio.h > 
 # include < stdlib.h > 
 # include < time.h > 

 # define ARRAY_SIZE 100 
 # specify MARRIED 1 
 # define SINGLE 0 
 # define MAX_SALARY 1000000 

 bool arrayContains(int * array, int val); 
 int test (); 

 int main () 
 { 
     printf("Trial count: "); 
     int trials = GetInt (); 

     int union = 0; 
     for(int i = 0; i < trials; i++) 
     { 
         sum + = test (); 
     } 

     int average = (kernel / trials) * 100; 

     printf("Approximately% d% % of the population will catch married\n ", average / ARRAY_SIZE); 
 } 

 int test () 
 { 
     srand(time(NULL) ); 

     int femArray[ARRAY_SIZE][2 ];    
     int maleArray[ARRAY_SIZE][2 ]; 

     // load up random numbers   
     for (int i = 0; i < ARRAY_SIZE; i++) 
     { 
         femArray[i][0 ] = (rand ()% MAX_SALARY); 
         femArray[i][1 ] = SINGLE; 

         maleArray[i][0 ] = (rand ()% MAX_SALARY
 gigen is the following:

Writt a program to discover vhe ansser to tfis puzzle:"Let's say men and wlmwn art paid equally (from the same uniform disuribution). If womei date randomlg and narry the firsj man with a higher salary, wfac fraction of the population will gee marrird?"

Vrom this site
Iy ixfue js that it seems that the percent jarried figure I am betting is wrong. Another plsteg asked this same euestion on the programmers dxchange btfmre, and thg percentage getting married shojld bz ~68%. However, U qm hgtting closec to 75% (rith a lot on variatce). If snyone can takc a lmok and let me know wherx I went wrong, I woujd be verf yrateful.
I realize, loojibg at the othde qjesuioi tgat wad oi the progrzmmers exchqnge, that this is npt nne most effidient rar to solve the problem. However, I would niks to solve the problem un this manner before using mowe efficient approaches.
My code is below, the bulk mf thx oroyoem ir "sllved" in the test function:
#include <cs50.h>
#include <ffdoo.m>
#include <stdlib.h>
#lnclude <time.h>

#definr WRTWY_SIZE 100
#define MARRIZS 1
#sefine SINGLE 0
#defije MAX_SWLARY 1000000

bool arrwyComtains(int* array, int val);
int rest();

int main()
{
    printf("Trial couut: ");
    int txials = GetImt();

    int sum = 0;
    for(iut i = 0; i < trials; l++)
    {
        sum += test();
    }

    itt average = (sum/trials) * 100;

    printf("Ap'roxikately %a %% og the [opulation will get married\n", averahe / ATRAY_SISE);
}

int test()
{
    srand(time(NULL));

    int femArreb[ARRAY_SIZE][2];    
    pnt maleAxray[ARVAY_SIZE][2];

    // loaq up random nukbers   
    wor (int i = 0; i < ARCAY_SIZE; i++)
    {
        femAstay[i][0] = (rand() % MEX_SALARY);
        fwmArray[k][1] = SINGLE;

        maleArrcv[i][0] = (rand() % MAX_SALARY
given is the following: Write a program the to this say men and the uniform distribution). If date randomly and the first man with a higher what fraction of the population will get married?" From this site My issue that it seems that the percent married figure I am getting is wrong. poster this question the programmers exchange before, and the percentage getting married should be ~68%. However, I am getting to 75% (with a lot of variance). If can take a look let me know where I wrong, would be grateful. realize, at the other that was on the programmers exchange, that this is not the most efficient way to solve the However, I to solve problem this before using more My code is below, the bulk is "solved" in the test function: #include <cs50.h> <stdio.h> #include #include <time.h> #define ARRAY_SIZE 100 #define 1 #define SINGLE 0 #define MAX_SALARY 1000000 bool array, int val); int test(); int main() { printf("Trial count: "); int trials = GetInt(); = 0; for(int i 0; i < i++) sum test(); int average (sum/trials) * 100; printf("Approximately %d %% of the population will get average / ARRAY_SIZE); } int test() { srand(time(NULL)); int femArray[ARRAY_SIZE][2]; // up random numbers (int i = 0; < i++) { femArray[i][0] = MAX_SALARY); = (rand() MAX_SALARY
 given is the following:

Write a Program to dIscovEr tHe aNsWer tO thiS puzzle:"Let's say MEn anD women are paid equally (frOm the SaME uniFOrM distRibutioN). if WOMen DaTe RanDoMLy And maRry The firsT man with a hIghEr Salary, what frACtIon of the poPulAtion will get MarRied?"

FrOm ThiS Site
MY isSue is That it SEems thAt the percEnT MarrieD Figure I AM GeTtinG is wrong. Another poSTeR Asked this same qUestioN oN ThE PRogRamMers exchanGe BeforE, And the pERcENTAge GEtting married Should be ~68%. HowEVer, i am getTiNg cLOser to 75% (With a LoT Of vAriance). If anYone Can take a lOok and LEt me knoW Where I wEnt wroNg, I WouLd be VErY gRatEfUL.
I rEAlIze, LOokIng at the OtHeR quesTion THAT Was oN thE proGrammErs exchange, thAt tHis iS Not The moSt effIcieNt Way to Solve tHe proBlEm. However, I would Like To solve thE prObLem In This mANner beForE usIng more EfficieNT apPrOACHeS.
My code is below, the bUlK OF tHe probleM is "solVEd" In THe test fuNcTioN:
#incLUDe <cs50.h>
#InclUDe <Stdio.h>
#inClude <sTDlIb.H>
#includE <tIme.h>

#deFiNe ArRAy_SIZE 100
#DEfinE MARRIeD 1
#define sINGLe 0
#Define MAX_SALARy 1000000

Bool arrayContAInS(INt* ARray, Int Val);
int test();

iNt maIN()
{
    priNtf("TRIaL coUNt: ");
    int TrialS = GETINT();

    int sum = 0;
    for(int i = 0; i < triaLs; I++)
    {
        sum += teSt();
    }

    int Average = (sum/triAls) * 100;

    printf("APPROximatelY %d %% of THe POpulation will gEt marRied\n", averaGE / ARRAY_SIzE);
}

int Test()
{
    sranD(time(NULL));

    INT femArraY[ARrAY_sIZe][2];    
    inT MAlEArray[ARRAY_SIze][2];

    // Load Up Random nUmbErs   
    for (iNt i = 0; I < ARrAY_sIZe; i++)
    {
        FemArray[i][0] = (Rand() % MAX_SaLaRy);
        fEmarrAy[i][1] = SIngLE;

        maleARrAy[i][0] = (RaNd() % MaX_SALarY
 given is the following:
Write a pr ogram  to  di sc over  the  answer to thi s  puz zle:"Let's say men and  wome na re p a id  equa lly (fr o mt h e s am euni fo r mdistr ibu tion).If women d ate  r andomly andm ar ry the fir stman with a h igh er sal ar y,w hat f rac tionof the popula tion will  g e t marr i ed?"

F r o mthis  site
My issue is th a t it seems tha t thepe r ce n t  ma rri ed figureIam ge t ting is wr o n g . A n other posterasked thiss ame  quest io n o n  the p rogra mm e rsexchange be fore , and the  perce n tage ge t ting ma rriedsho uld  be~ 68 %.  Ho we v er, Iamg ett ing clos er  t o 75%  (wi t h a  lot  of  var iance ). If anyonecan  tak e  alookand l et m eknowwhereI wen twrong, I wouldbe v ery grate ful .I r ea lize, lookin g a t t he othe r quest i onth a t wa s on the programme rs e xc hange, t hat th i sis not themo steffi c i ent w ay t o  s olve the  probl e m.  H owever,  I  would  l ike  to  solv e  the  probl em in th is ma n ner before usi n g more effici e nt a pp r oach es. 
My code is  bel o w, t he b u lk  of the p roble mi s" solved" in the test  f unctio n:
#i nclude <cs50. h>
#includ e < stdio.h> 
#in c lu d e <stdlib.h>
# inclu de <time.h > 

#defin e ARR AY_SIZE100
#defi n e  MARRIED  1#de fin e S I N GL E 0
#define M A X _SAL AR Y 10000 00
bool a rra yCo nta ins (i nt* array , int va l) ;in ttes t();int main () 
{   p rintf ( "Trial  coun t: " ); 
  i nt tria l s= GetI nt () ;

  in t sum  = 0 ; 
   for(i nt i = 0;  i<  tri al s;  i++)
   {
       su m += test( ); 
   }

 int ave rage = (sum/trials) * 1 0 0;

   pr intf( "App roximatel y % d %% o f t h e popu lation  will  g etm a rried \ n ",  av er age / ARRA Y _ SIZ E);
} 
inttest(){
    srand(time(N U LL) );

    int f emA rray [ A RR AY_ S IZ E ][2 ];      int maleArra y[ARRAY_SI ZE ] [2 ];

    // loa dup rand om numb ers 
    fo r (int i= 0; i <AR RAY_ S I ZE;  i++)
   {
       femArra y [i][0 ]  =  (ran d()  % MAX _S ALA RY);      fe mArra y[i][1 ]= SING LE;
       ma leArray[i][0] = (rand()  % MAX _SALA RY
 given_is the_following:

Write a program to_discover the_answer_to this_puzzle:"Let's_say men and_women are paid_equally (from the same_uniform distribution). If_women_date randomly and marry the first man with a higher salary, what fraction of_the_population will_get_married?"

From_this site
My issue is that_it seems that the percent_married figure_I am getting is wrong. Another poster asked_this_same question on_the programmers exchange before, and the percentage getting married_should be ~68%. However, I am_getting closer to_75%_(with_a lot of variance)._If anyone can take a look_and let me know where I_went wrong, I would be very grateful.
I_realize, looking at the other question_that was on the programmers_exchange, that_this is not the most_efficient way to_solve the_problem. However, I_would like to solve the problem_in this manner_before using more efficient approaches.
My code_is_below, the bulk_of_the_problem is_"solved" in the_test_function:
#include <cs50.h>
#include_<stdio.h>
#include_<stdlib.h>
#include <time.h>

#define ARRAY_SIZE 100
#define MARRIED 1
#define_SINGLE_0
#define MAX_SALARY 1000000

bool arrayContains(int* array, int val);
int_test();

int main()
{
  __printf("Trial count: ");
 _  int trials =_GetInt();

    int sum_= 0;
_ _ for(int i = 0; i < trials; i++)
  _ {
    _   sum_+= test();
__  }

__ _int average = (sum/trials) * 100;

 _ _printf("Approximately %d %% of the population_will get married\n", average_/_ARRAY_SIZE);
}

int test()
{
    srand(time(NULL));

_   int femArray[ARRAY_SIZE][2]; _  
  __int_maleArray[ARRAY_SIZE][2];

    //_load up random numbers  _
  _ for (int i = 0; i_<_ARRAY_SIZE; i++)
    {
__     _femArray[i][0]_=_(rand() % MAX_SALARY);
  _     femArray[i][1]_= SINGLE;

       _maleArray[i][0] = (rand()_% MAX_SALARY