Целочисленное деление VB.NET и C # [дубликат]

This question already has an answer here:

Anyone care to explain why these two pieces of code exhibit different results?

VB.NET v4.0

Dim p As Integer = 16
Dim i As Integer = 10
Dim y As Integer = p / i
//Result: 2

C# v4.0

int p = 16;
int i = 10;
int y = p / i;
//Result: 1
80
задан BoltClock 17 May 2011 в 04:16
поделиться