lundi 14 juin 2021

Random number in FOR loop expression in C language

I'm trying to figure out the behavior of for(i = 0; i < rand(); ++i) where I'm not sure if the second expression is supposed to generate a new random number each time the loop iterate or just when it executes for the first time.

Tried to find out by comparing the program execution times but no luck as there were no big differences between them.

Does the random number generates once or each time the loop iterate?




Aucun commentaire:

Enregistrer un commentaire