CJCoding With Joseph
← Back to Question List
C# Code Walkthrough #32

Casting Doubles to Int

mediumCasting

📄 Code

Read carefully — what does this print?
1double d = 9.99;
2int i = (int)d;
3Console.WriteLine(i);
4Console.WriteLine((int)7.5 + (int)2.5);

🎯 Your Answer