question for visual basic for calculate the sum of the number digits?
ymdian asked:
Write a Visual Basic program that will take an integer as input and return the sum of that integer’s digits. For example: if the integer 32456 is entered, the result should be 3+2+4+5+6 = 20. The integer can be of variable length (it can have any number of digits). You should use a loop to process the integer.
Related posts:
- visual basic programming? samuel s asked: trying to write the code to get...
- How do I write this substring code in Visual Basic? Robert Nesta M asked: I am writing a Visual Basic...
- This is about Visual BASIC programming? gigolo asked: Situation is.. Using Case select and if statements....
- I have a question here about Visual Basic programming, hope you guys will answer:? bill asked: I want to create a program (in Standard...
- Really Challenging Visual Basic Question Problem? ABC asked: I have a little problem. I need to...
Filed Under Programming & Design |
Tagged With Number Digits, Variable Length, Visual Basic Program
Comments
One Response to “question for visual basic for calculate the sum of the number digits?”
Use this function:
Function DigitSum(ByVal N As Integer) As Integer