+ 1
Write a program in C++ to find the sum of digits and counting of digits.
The program must be in C++language
6 odpowiedzi
+ 11
as Nikhil said if you have any programming related query please first show your attempt else it looks like homework to all and you don't get the proper response so show your attempt first you will get positive responses
+ 10
Please show us your attempt first.. It'll actually help you in learning better.
If you've no idea how to start...then here's a hint for finding the sum of digits -
* Find the remainder when divided by 10. add this to a variable
* Divide the number by 10 and change the value of the number variable to the quotient.
* Repeat the process until the number is larger than 0.
+ 8
The process is similar for counting too..
Use a while loop until the number is larger than 0 ... Divide by 10... update the new value with the quotient.. and everytime increment the value of a variable ( for holding the total numbers ) by 1
+ 1
what about counting?
+ 1
acha okay
0
pls give me the input
it's urgent...
hope u will help:)