Write a C++ program to count the no. of digits in a number entered by the user (Use do-while loop). Your program must have the following requirement.
a. Your program must accept an integer number from the keyboard.
b. Most lines should have a comment
c. The results must be displayed on the computer screen exactly as shown below:
Program to count the no. of digits in a given number
--------------------------------------------------------------
Enter a number: 1234567890-------------User Input
No. of digits in 1234567890 are 10
Press any key to continue . . .
We wont do your homework for you. What attempts have you made to solve these problems? Show your code and we will be happy to help you when you get stuck.
Do your homework yourself, or post your attempts so far. You should not expect other people, with their own lives (presumably although not so much in my case ;] ) and things to do to do what you should be able to do, had you listened in class (you would at least be able to start). Asking specific questions is fine as it at least shows you are trying to actually learn. But we won't do it for you.
The teacher would not set you homework you could not plausibly do; (unless he was a complete moron like my maths teacher, which I doubt because there's no such thing as a bigger idiot than this guy) so the possibilities are thus;
1. You haven't bothered to listen in class, and as such have no idea what you're doing
2. You can't be bothered to do your homework
3. You have a bunch of specific questions that you 'forgot' to post.