From 2c92915be74d5a6bea4d05f56d804655b61bd9cf Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:08:40 -0600 Subject: [PATCH] vault backup: 2024-10-07 15:08:40 --- education/software development/ECE1400/C.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/education/software development/ECE1400/C.md b/education/software development/ECE1400/C.md index 48785ee..9d12e93 100644 --- a/education/software development/ECE1400/C.md +++ b/education/software development/ECE1400/C.md @@ -111,6 +111,12 @@ If an ordinary character is included in the pattern matching string, it will be ## `rand` ```c // `srand` creates a seed to use for rng -seed = srand(time(NULL)); +srand(time(NULL)); + +// `rand` generates a random integer between 0 and `RAND_MAX` +// To pick a number between a particular range, you can use the modulo +// operator. +// The below example picks a number between zero and four. +int num = rand() % 4; ``` \ No newline at end of file