I am a beginner. Both situations below deliver the same output, but are they exactly the same when compiling? if not, in which case the use of one or the other is preferable?
int num1 = 1001;
int num2 = 505;
double num11 = num1;
double result1 = num11 / num2;
double result2 = (double)num1 / num2; // or (double)num1 / (double)num2;
Console.WriteLine("result1 = " + result1);
Console.WriteLine("result2 = " + result2);
/* Output:
result1 = 1.98217821782178
result2 = 1.98217821782178
*/