In C-based languages the result of dividing an integer by an integer is always an integer. If you want the result to be a decimal then at least one of the numbers must be a decimal. Change this:
C# Code:
ave = (nmb1 + nmb2 + nmb3) / 3;
to this:
C# Code:
ave = (nmb1 + nmb2 + nmb3) / 3M;
and you'll get the result you want. Note that the "M" suffix is short for "money" and forces the preceding number to type decimal. Alternatively you could do this:
C# Code:
ave = Convert.ToDecimal(nmb1 + nmb2 + nmb3) / 3;
or this:
C# Code:
ave = (nmb1 + nmb2 + nmb3) / (decimal)3;