Random Number

What will be tha output of random numbers in line below?

 
 if((abs(pid)==5 && rand()%100<60) || (abs(pid)==4 && rand()%100<10)){
Last edited on
nothing.
the random numbers are being used to decide whether to enter the if statement executed block which you left out. There is no output here.

this code is like saying
roll a 6 sided die
if the die is 1,2 or 3, then do something.
if not, do not do anything.

why not use <random> here?
Last edited on
Topic archived. No new replies allowed.