Why I cannot the get percentage by using Int
Posted
by Daoming Yang
on Stack Overflow
See other posts from Stack Overflow
or by Daoming Yang
Published on 2010-04-08T17:20:35Z
Indexed on
2010/04/08
17:23 UTC
Read the original article
Hit count: 188
c#
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.
© Stack Overflow or respective owner