i would like to know why there is a difference in the output from my gcc compiler in Sublime Text 3 on Windows 10 and the expected output? If so how can i change the compile
From C11 standard:
7.22.2.1 The rand function
... Footnote: There are no guarantees as to the quality of the random sequence produced and some implementations are known to produce sequences with distressingly non-random low-order bits. Applications with particular requirements should use a generator that is known to be sufficient for their needs.
This quote makes clear that rand
and srand
are implementation defined, and the sequence of the program (used for grading!) is also implementation defined.