System.Console.WriteLine(int.MaxValue);
This line gives me the answer of 2147483647 as I have a 32-bit PC.
Will the answer be same on a 64-bit PC?
System.Console.WriteLine(int.MaxValue);
This line gives me the answer of 2147483647 as I have a 32-bit PC.
Will the answer be same on a 64-bit PC?
Yes.
Source: https://www.dotnetperls.com/int-maxvalue
int
is just an alias forInt32
- it's defined in the C# specification. Thereforeint.MaxValue
is the same asInt32.MaxValue
which will always be 2147483647.Yes, the answer will be the same on a 64-bit machine.
In .NET, an
int
is a signed 32-bit integer, regardless of the processor. Its .NET framework type isSystem.Int32
.The C# Language specification states: