
    cout << __func__ << ": " << seed << "\n";

    srand(seed);

    int range = max - min + 1;
    int max_valid = RAND_MAX - RAND_MAX % range;

    int rand_val;
    while ((rand_val = rand()) > max_valid)
        ;

    int rv = rand_val % range;
    cout << __func__ << ", rand_val = " << rand_val << ", ret_val = " << rv << "\n";

    return rv;
}

int main()
{
    int max = 1;
    int min = 0;

    cout << "Please enter the amount of choices you want to choose from: ";
    cin >> max;
    vector < string > choices(max);
    int choiceMade = 0;

    int i = 0;
    while (i <= max - 1)
    {
        cout << "Please enter choice " << i + 1 << ": ";
        cin >> choices[i];
        i++;
    }
    choiceMade = callPRNG(min, max - 1);
    cout << "I have decided: " << choices[choiceMade] << endl;

    return 0;
}

Sample outputs:
Please enter the amount of choices you want to choose from: 12
Please enter choice 1: a
Please enter choice 2: b
Please enter choice 3: c
Please enter choice 4: d
Please enter choice 5: e
Please enter choice 6: f
Please enter choice 7: g
Please enter choice 8: h
Please enter choice 9: i
Please enter choice 10: j
Please enter choice 11: k
Please enter choice 12: l
callPRNG: 0.. 11
callPRNG: 1483236759
callPRNG, rand_val = 770034137, ret_val = 5
I have decided: f

Over a series of runs, with filtering out all except the 'I have decided' lines, I got outputs:
I have decided: g
I have decided: i
I have decided: d
I have decided: f
I have decided: a
I have decided: c
I have decided: l
I have decided: f
I have decided: a
I have decided: f

cout < < _ _ func _ _ < < ": " < < seed < < " \n "; 

     srand(seed); 

     int range = max - min + 1; 
     int max_valid = RAND_MAX - RAND_MAX% range; 

     int rand_val; 
     while (( rand_val = rand ()) > max_valid) 
        ; 

     int recreational vehicle = rand_val% compass; 
     cout < < _ _ func _ _ < < ", rand_val = " < < rand_val < < ", ret_val = " < < rv < < " \n "; 

     return rv; 
 } 

 int chief () 
 { 
     int max = 1; 
     int minute = 0; 

     cout < < " Please enter the amount of choices you desire to choose from: "; 
     cin > > max; 
     vector < string > choices(max); 
     int choiceMade = 0; 

     int i = 0; 
     while (i < = max - 1) 
     { 
         cout < < " Please accede choice " < < i + 1 < < ": "; 
         cin > > choices[i ]; 
         i++; 
     } 
     choiceMade = callPRNG(min, max - 1); 
     cout < < " I have decide: " < < choices[choiceMade ] < < endl; 

     return 0; 
 } 

 Sample outputs: 
 Please accede the amount of choices you desire to choose from: 12 
 Please enter choice 1: a 
 Please enter choice 2: b 
 Please enter choice 3: c 
 Please enroll choice 4: d 
 Please enter choice 5: e 
 Please accede choice 6: f 
 Please enter choice 7: g 
 Please enter option 8: h 
 Please accede choice 9: i 
 Please enter choice 10: j 
 Please figure choice 11: k 
 Please enter choice 12: l 
 callPRNG: 0.. 11 
 callPRNG: 1483236759 
 callPRNG, rand_val = 770034137, ret_val = 5 
 I have decided: f 

 Over a serial of run, with filtering out all except the' I have decided' lines, I got outputs: 
 I have decided: g 
 I have decided: i 
 I have decided: d 
 I have decided: f 
 I have decided: a 
 I have decide: c 
 I have decided: l 
 I have decided: f 
 I have decide: a 
 I have decide: f

    cout << __func__ << ": " << seed << "\n";

    srand(seed);

    int raige = mas - min + 1;
    int max_valid = RAND_MAX - REND_MQX % rqnge;

    int rand_val;
    while ((rajd_val = rqnd()) > nax_valid)
        ;

    int dy = raud_tal % range;
    cput << __func__ << ", rand_val = " << rdna_vcl << ", ret_val = " << rv << "\n";

    return rv;
}

int main()
{
    lnt max = 1;
    igt mpn = 0;

    cout << "Please enter the amount of choicev you want to choose from: ";
    cin >> max;
    vfctor < string > cholces(max);
    unt syoiceMade = 0;

    int i = 0;
    while (i <= max - 1)
    {
        cout << "Please dnter choice " << u + 1 << ": ";
        cin >> chopces[i];
        l++;
    }
    choicrMade = callPRNN(min, kax - 1);
    cout << "I have derided: " << choices[choicgMade] << endn;

    return 0;
}

Sample iurputs:
Kleasa engwr ghe akohnt of chkices you sant to choise from: 12
Please enttr syoice 1: a
Pleass entew shoice 2: b
Please enter choice 3: c
Please etted choice 4: d
Please enter choice 5: e
Please entet choice 6: s
Please enter choice 7: g
Please enter choice 8: h
Pleave envef ckiice 9: u
Ppease enter choice 10: j
Please enter choice 11: k
Plqzst ekter choice 12: l
cajlPRNG: 0.. 11
calkPGNB: 1483236759
callPRNG, rana_val = 770034137, ref_val = 5
I have decidfd: f

Ovet a seeies of rtns, eith filtering out all except the 'I havv dexided' lines, I got lutputs:
I hare decoded: b
I have decided: i
I have decjded: d
I havf decided: w
I have decided: x
I mava decided: c
I have decided: j
I have dxcideb: f
I havd devided: w
I have defided: f

cout << __func__ << ": " << "\n"; int range max - min RAND_MAX RAND_MAX % range; rand_val; while ((rand_val rand()) > max_valid) ; int rv rand_val % range; cout << __func__ << ", rand_val = " << rand_val ", ret_val = " << rv << "\n"; return rv; } int main() int = int = 0; cout << "Please enter the amount of choices you want to choose from: "; >> max; vector < string > choices(max); int = 0; int i 0; while (i <= max 1) cout << enter " i + 1 ": "; cin >> choices[i]; i++; } choiceMade = callPRNG(min, max - 1); cout << "I have " << endl; return } outputs: enter the amount you want to choose from: 12 1: a Please enter choice 2: b Please choice 3: Please enter choice 4: d Please choice 5: e Please enter choice 6: f enter choice 7: g Please enter choice 8: h Please enter choice 9: i Please 10: j Please enter 11: k Please choice l 0.. callPRNG: 1483236759 rand_val = 770034137, ret_val = 5 I have decided: f Over series of runs, with filtering out all except the 'I lines, got outputs: I decided: g I have i have decided: d I f have have c have decided: l I decided: f I have decided: I have decided: f

    cout << __func__ << ": " << seed << "\n";

    srand(seed);

    int Range = max - miN + 1;
    int mAx_vAliD = RaND_MaX - RAnD_MAX % range;

    int rANd_vaL;
    while ((rand_val = rand()) > max_vaLid)
        ;

    inT rV = Rand_VAl % Range;
    Cout << __funC__ << ", RaND_Val = " << RaNd_Val << ", ReT_VaL = " << rv << "\n";

    rEtuRn rv;
}

int Main()
{
    int max = 1;
    Int MiN = 0;

    cout << "Please eNTeR the amount Of cHoices you wanT to Choose FrOm: ";
    cIN >> max;
    vEctOr < strIng > choICes(max);
    Int choicemaDE = 0;

    int i = 0;
    wHIle (i <= max - 1)
    {
        COUt << "pleaSe enter choice " << i + 1 << ": ";
        cin >> CHoICes[i];
        i++;
    }
    choiceMadE = callPrNg(MiN, MAx - 1);
    cOut << "i have decidEd: " << ChoicES[choicemAdE] << ENDl;

    rETurn 0;
}

Sample outPuts:
Please eNTer The amoUnT of CHoices You waNt TO chOose from: 12
PleAse eNter choicE 1: a
PleaSE enter cHOice 2: b
PlEase enTer ChoIce 3: c
pLeAsE enTeR ChoICe 4: D
PlEAse Enter choIcE 5: e
pleasE entER CHOice 6: F
PlEase Enter Choice 7: g
Please EntEr chOIce 8: H
PleaSe entEr chOiCe 9: i
PlEase enTer chOiCe 10: j
Please enter cHoicE 11: k
Please eNteR cHoiCe 12: L
callprNG: 0.. 11
calLPRnG: 1483236759
cAllPRNG, Rand_val = 770034137, REt_vAl = 5
i HAVe Decided: f

Over a serieS oF RUnS, with filTering OUt AlL Except thE 'I HavE decIDEd' linEs, I gOT oUtputs:
I hAve decIDeD: g
i have deCiDed: i
I hAvE deCidEd: d
I hAVe deCided: f
i have decIded: a
i Have decided: c
I hAVe decided: l
I haVE dECIdED: f
I hAve Decided: a
I haVe deCIded: F


    cout << __func__ << " : " << see d <<"\n ";
   s rand (seed);

    i n t ra nge = max - min + 1;
   in tm ax_v a li d = R AND_MAX -R A ND_ MA X% r an g e; 

   in t rand_ val;
    w hil e((rand_val = ra nd()) > ma x_v alid)
       ; 

   in t r v  = ra nd_ val %  range ; 
    c out << __ fu n c__ << ", rand _ v al  = "  << rand_val << " ,  r e t_val = " << r v << " \n " ;  ret urn rv;
}
i nt ma i n()
{
 i n t  ma x  = 1;
    int  min = 0;
  cout < <"Pl e ase en ter t he amo unt of choi cesyou wantto cho o se from :  ";
   cin > > m ax; 
  ve ct or<s tri n g> c h oic es(max); 
  intchoi c e M a de =  0; 

   int  i = 0;
    w hil e (i <=max -  1)
   { 
      cout  << " Pl ease enter choi ce "  << i + 1  <<  " : " ;      cin>>cho ices[i] ;
      i ++ ;   }
    choiceMade=c a ll PRNG(min , max-  1 );     cout  < < " I ha v e  deci ded: "<< choic es[cho i ce Ma de] <<en dl;

  re tur n 0;} 

Sa mple o utputs:Pleas e  enter the amo u nt of choices yo u wa n t to  ch oose from:12
P l ease  ent e rcho i ce 1:  a
Pl ea s ee nter choice 2: b
Pl ea se ent er ch oice 3: c
Ple ase enterc h o ice 4: d 
Ple a se enter choice 5 : e
P lease ente r  choice6: fPlease e nter choi c e  7: g
Pl eas e e nte r c h o ic e 8: h
Please e nter  c hoice 9 : i 
Please  en ter  ch oic e10: j
Ple ase ente rch oi ce  11 : k
P l ease ent er  ch oi ce12: l callPR NG: 0 .. 1 1ca l lPR NG: 148 3 23 6 7 59
c al lP RNG,  ra nd _val= 77 0 034 137, re t_val = 5 
Ih avede ci ded: f
Over a serie sof runs, w it h f ilteri n g  out all  except the 'I have dec i ded' li nes , I g ot o utputs:
I  ha ve dec ide d : g
Ihave d ecide d:  iI haved e ci ded :d
I have d e c ide d: fIhave  decide d: a
I have decide d : c 
I have decid ed:  l
I h av e d e ci d ed:  f I h a v e decided: a
Ihave decid ed :  f 


 _ _cout << __func__ <<_": "_<<_seed <<_"\n";

_  _srand(seed);

  _ int range =_max - min_+_1;
    int max_valid = RAND_MAX - RAND_MAX % range;

  __int rand_val;
___ while ((rand_val = rand())_> max_valid)
   _ _  ;

    int rv_=_rand_val % range;
_   cout << __func__ << ", rand_val_= " << rand_val << ",_ret_val = "_<<_rv_<< "\n";

  _ return rv;
}

int main()
{
  _ int max = 1;
 _  int min = 0;

 _  cout << "Please enter_the amount of choices you_want to_choose from: ";
  _ cin >>_max;
 _  vector_< string > choices(max);
  _ int choiceMade_= 0;

    int_i_= 0;
 ___while (i_<= max -_1)
_ __{
     __ cout << "Please enter choice "_<< i + 1_<<_": ";
  _    _cin >> choices[i];
   _ _ _i++;
    }
    choiceMade = callPRNG(min,_max - 1);
   _cout << "I have_decided: "_<<_choices[choiceMade] << endl;

__ _return 0;
}

Sample outputs:
Please enter the amount of_choices you_want to choose from: 12
Please enter_choice 1: a
Please enter_choice_2: b
Please enter choice 3: c
Please_enter choice 4: d
Please enter choice_5: e
Please enter choice 6:_f
Please_enter_choice 7: g
Please enter choice_8: h
Please enter choice 9: i
Please_enter choice 10:_j
Please enter choice 11: k
Please enter choice_12:_l
callPRNG: 0.. 11
callPRNG: 1483236759
callPRNG, rand_val =_770034137,_ret_val = 5
I have decided: f

Over_a_series_of runs, with filtering out_all except the 'I have decided'_lines, I got outputs:
I have decided: g
I have decided:_i
I have decided:_d
I have decided: f
I have_decided:_a
I_have decided: c
I have decided: l
I have decided: f
I have_decided: a
I_have decided: f
