ProgrammingVery hard

A linear congruential generator x = (1103515245 x + 12345) mod 2^31 starts with x = 1. What is the next value?

  1. A. 1103515245
  2. B. 12346
  3. C. 1103527590
  4. D. 1103527591

Correct answer: C. 1103527590

1103515245 + 12345 = 1103527590, which is below 2^31, so the modulus does not change it.

More C Programming questions

Exams that ask this topic