Skip to content

Commit ca7b5c5

Browse files
authored
Merge pull request #10347 from cmkaya/patch-1
Use ToDouble() instead of ToInt32() for double type variable
2 parents 0010f39 + dec21dd commit ca7b5c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/get-started/csharp/tutorial-console.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ Let's change the code to handle this error. In *Program.cs*, replace the code fo
395395
while (num2 == 0)
396396
{
397397
Console.WriteLine("Enter a non-zero divisor: ");
398-
num2 = Convert.ToInt32(Console.ReadLine());
398+
num2 = Convert.ToDouble(Console.ReadLine());
399399
}
400400
Console.WriteLine($"Your result: {num1} / {num2} = " + (num1 / num2));
401401
break;

0 commit comments

Comments
 (0)