# Answer to Question #65337 in C++ for Polly Williams

Question #65337

CalculateLength.c: This function calculates the length of an integer number by dividing

it by 10 iteratively. (Please don’t use the math library to calculate the length)

it by 10 iteratively. (Please don’t use the math library to calculate the length)

Expert's answer

int CalculateLength(int number)

{

int length = 1;

while ((number/=10)!=0)

length++;

return length;

}

{

int length = 1;

while ((number/=10)!=0)

length++;

return length;

}

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment