Please forgive my programming knowledge. I know this is a simple thing, but I do not understand why result is always 0. Why decimal will be fine?
int a = 100;
int b = 200;
decimal c = (a / b) * 100;
Many thanks.
Integer division always truncates the remainder. This is done at the time that the number is divided, not when it's assigned to the variable (as I'm guessing you assumed).
decimal c = ((decimal)a / b) * 100;