#purpose : method to get the decimal position based on passed number
private static int GetDividebyValue(int dec_position)
{
return ((dec_position == 1) ? 1 : (10 * GetDividebyValue(dec_position - 1)));
}
//calling method
int dividby = GetDividebyValue(decimal_position+1);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment