Question: 2. (Return number of digits) Write a function that returns the number of digits in an Integer using the following header: int getSize(int n) For
2. (Return number of digits) Write a function that returns the number of digits in an Integer using the following header: int getSize(int n) For example, getSize(45) returns 2, getSize(3434) returns 4, getSize(4) returns 1, and getSize(0) returns 1. Write a test program that prompts the user to enter an integer and displays its size
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
