I am wondering if you are getting the 'right' answer when it is quite large. Remember that the int datatype can store a maximum positive value of 2147483647 (ref: https://www.w3schools.com/cs/cs_data_types.asp). What do you think happens when this limit is reached? Hint try the number 17 as input.
You could use the long datatype, but even this maxes out quite quickly. See this fork of your program: https://replit.com/@malvoliothegood/Factorial-test-1#main.cs
@Bunnytoes Yes, as long it is not for some assessment, and you understand the code. Otherwise it is best to use your own code.
There is a bug in the program though. If n is big enough fact will have wrapped around enough to be in the positive range, then the if (fact < 0) test won't do its job. There is a way around this though - you could test values of n until a negative value for fact occurs, and then enforce this limit on the user.