The Exception Message is telling you what the problem is; the number is too large for the assigned type, Int32.
Reading the documentation for the
int.Parse()
method will confirm this
MS Documentation
s represents a number less than MinValue or greater than MaxValue.
Now if you would have a
try...catch
block you could have caught that error, and properly reported it back
int num;
Console.Write("Please write your number here:");
try {
num = Int32.Parse(Console.ReadLine());
if (num < 0) { Console.WriteLine("This number is a positive number!"); }
if (num > 0) { Console.WriteLine("This number is a positive number!"); }
}
catch (OverflowException) { Console.WriteLine("Error: this number is way too big for an Int32!":); }
Also.. you may want to check your logic
if (num < 0) ...Console.WriteLine("This number is a positive number!");
Reference:
Int32.Parse Method (System) | Microsoft Docs[
^]
OverflowException Class (System) | Microsoft Docs[
^]