Explicit Cast
Explicit casts (using (type)) are required when data loss may occur.
double d = 123.45;int i = (int)d; // truncatesConsole.WriteLine($"double: {d}, int: {i}");Run the Application
Section titled “Run the Application”dotnet runResult
Section titled “Result”double: 123.45, int: 123