How do i get the exact random number, a random number function generates

Pls help!!! i am working on a game simulation that generates random numbers between 1 to 5 in the debug log with the click of a button and also accepts number input from the player. Now i want to check if the random number generated is the same as the number entered by the player. How do i get the exact value of a random number generated by unity’s debug log so i can use if else statements to check if they tally. Thanks in advance.

This is the code i used—everything works except the if else statement at the end

#pragma strict

var biggestNumber: int = 100;

var smallestNumber: int = 0;

//GUI Button Variables:

var buttonWidth : int = 500;

var buttonHeight : int = 200;

static var randomChance: int;

function OnGUI(){

if(GUI.Button(Rect(15,10,300,68), “Click to Generate a random number!”)){

var randnum = (Random.Range(1,6));

print (randnum);
}
}
function Update () {

var randnum = (Random.Range(smallestNumber,biggestNumber));

	for (var c : char in Input.inputString) {
		// Backspace - Remove the last character
		if (c == "\b"[0]) {
			if (guiText.text.Length != 0)
				guiText.text = guiText.text.Substring(0, guiText.text.Length - 1);
		}
		
		// End of entry
		else if (c == "

"[0] || c == “\r”[0]) {// "
" for Mac, “\r” for windows.
print ("You entered the number: " + guiText.text);
}
// Normal text input - just append to the end
else {
guiText.text += c;
}
if (c == "
"[0] || c == “\r”[0] && guiText.text==randnum)
{
print ("The Small cell is now Connected to the Mobile Device with the Number " + guiText.text);
}

else if (c == "

"[0] || c == “\r”[0] && guiText.text!= randnum)
{
print ("The Small cell cannot Connect to the Mobile Device with the Number " + guiText.text);
}
}
}

I think what you are trying to ask is how to convert a string number to an integer. If so, you may find this helpful: Convert.ToInt32 Method (System) | Microsoft Learn.

or you could use this: