answersLogoWhite

0


Best Answer

Function sum_odd_digits(ByVal number As Integer) As Integer

Dim digit As Integer

sum_odd_digits = 0

While number <> 0

digit = number Mod 10

If digit And 1 Then sum_odd_digits = sum_odd_digits + digit

number = number / 10

End While

End Function

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a visual basic program to sum the odd number digits of a 12 digit code using division and Mod and while loops?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What has the author John Smiley written?

John Smiley has written: 'Learn to Program Databases With Visual Basic (Learn to Program)' 'Learn to Program Visual Basic Objects (Learn to Program)' 'Learn to Program with Visual Basic 6' -- subject(s): BASIC (Computer program language), Microsoft Visual BASIC, Visual Basic (Computer program), Visual programming (Computer science), Windows (Computer programs) 'Learn to Program Visual Basic 6 Examples' 'Introduction to Programming with Visual Basic 6 Part 2' 'Learn to Program Visual Basic Examples (Miscellaneous)' -- subject(s): Microsoft Visual Basic for Windows, BASIC (Computer program language)


How do you calculate sum of digit of a given three digit number in visual basic?

simple program


Program to print all the even numbers of an array in visual basic?

find even number in array


How do you create a program in visual basic?

arrays programms in visual basic


Does the visual boy advance give you viruses?

No, the Visual Boy Advance program does not give you viruses. You can get a virus from files downloaded from unsafe sources and then used with the Visual Boy Advance program.


What are two visual cues that tell you that WordPad is the active program?

switch to wordpad .what are two visual cues that tell you that wordpad is the ac8t7ive program?


Who is the inventor of visual basic program?

microsoft


Vb is extension of?

A Visual Basic program.


What are the different program structure of visual basic?

Program in visual basic are the component being used by the programer that will give the user fast and easy way.


How do you write a program in visual foxpro?

Same with other Visual Basic program, programming in FoxPro will require you to have the right syntax.


How do you connect java with visual studio?

Unfortunately, you can not use Visual Studio to edit Java. Visual Studio can be used to program: Visual Basic C# C++ ASP.NET Anyways to program Java you can use other programs as Eclipse for Java Developers


Why visual basic is required?

visual basic is required for program the softwares,games,calculators etc