| question for visual basic for calculate the sum of the number digits?

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:

  1. visual basic programming? samuel s asked: trying to write the code to get...
  2. How do I write this substring code in Visual Basic? Robert Nesta M asked: I am writing a Visual Basic...
  3. This is about Visual BASIC programming? gigolo asked: Situation is.. Using Case select and if statements....
  4. I have a question here about Visual Basic programming, hope you guys will answer:? bill asked: I want to create a program (in Standard...
  5. Really Challenging Visual Basic Question Problem? ABC asked: I have a little problem. I need to...

Filed Under Programming & Design |

Tagged With , ,

Comments

One Response to “question for visual basic for calculate the sum of the number digits?”

  1. ArmchairPilot on May 1st, 2009 4:47 am

    Use this function:

    Function DigitSum(ByVal N As Integer) As Integer