logo CodeStepByStep logo

CountDigits

Language/Type: C# loops parameters return

Write a method named CountDigits that accepts an integer parameter and returns the number of digits in that integer. For example, CountDigits(38015) returns 5. For negative numbers, return the same value as if the number were positive. For example, CountDigits(-72) returns 2.

Method: Write a C# method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.