From b42e5f2cb8ce3ef385a25bc16a77effbd254c0e1 Mon Sep 17 00:00:00 2001 From: Sumit-do Date: Sat, 13 Jun 2026 22:33:48 +0530 Subject: [PATCH] Change random number range to 0-100 Updated random number generation to include 100. using rand() % 101 from rand() % 100 . --- Projects/C++ Projects/Basic/Guessing Game/text.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Projects/C++ Projects/Basic/Guessing Game/text.cpp b/Projects/C++ Projects/Basic/Guessing Game/text.cpp index 03e86e5..fc5070c 100644 --- a/Projects/C++ Projects/Basic/Guessing Game/text.cpp +++ b/Projects/C++ Projects/Basic/Guessing Game/text.cpp @@ -4,9 +4,14 @@ using namespace std; int main() { + // here in commits max_h=99 not h=100 because here h could be (random%100)-> [0-99] so h will be 99 not h = 100 + // to make h til 100 we need to find mod with 101 not 100 int attemp = 1,ans,guess=0,_won=0,h=100,l=0; srand(time(0)); - ans = rand() % 100; + // old line ans = rand() % 100; + // new commit or new line + ans = rand() % 101; + // change ( rand() % 100 )to (rand() % 101) cout<<"**** PLEASE READ INSTRUCTION ****"<