answersLogoWhite

0


Best Answer

I don't now visual basic, but to determine whether or not a number is even or odd, divide it by two twice, and round once. If the rounded result is equal to the non-rounded result, then the original number is even:

input n

if (n/2.0) == int(n/2.0)

print "the number is even"

User Avatar

Wiki User

βˆ™ 14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

βˆ™ 14y ago

"Odd"

Dim number As Integer

For number = 30 To 90000

If number Mod 2 = 1 Then

Listbox1.Items.Add(number)

End If

Next

"Even"

Dim number As Integer

For number = 30 To 90000

If number Mod 2 = 0 Then

Listbox1.Items.Add(number)

End If

Next

End Sub

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is an odd and even number program in visual basic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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

find even number in array


Is visual basic a GUI operating system?

Visual basic is not a GUI operating system. In fact it is not even an OS. It is just a platform to develop GUI software for windows using BASIC-like programming syntax.


What is the newest visual basic?

The final supported version was Visual Basic 6.0. Since then (1998~2008?) a langauge called Visual Basic .NET has joined the .NET framework. This is basically a complete redesign/reimplementation of the language for the new framework. Microsoft has even kept the VB version numbers in sequence with the original. The latest version of this language is Visual Basic 2008 (VB 9.0).


How do you make a program in Visual studio To know the number whether its Even or Odd?

using system; { public static void main(string[] args) { int n; n=int.parse(console.ReadLine()); if(n%2==0) console.WriteLine("Even number"); else console.WriteLine("Odd number"); } }


How do you write a program in Basic to display all the even numbers up to 100?

In visual basic: Module Module1 Sub Main() Dim Inst As Integer For Inst = 0 To 100 Step 2 Console.WriteLine(Inst) Next End Sub End Module


How check if a number is Even or Odd in GW Basic?

85


What type of language is visual basic?

basic is a general purpose, high level programming language. and the same is with the visual basic. but the main difference is that, the earlier basic was the dos version language. whereas the visual basic programming language is the language which is not DOS based. but the simplicity in the language remains the same as in basic.


What is a software that a programmer uses to write computer instructions?

microsoft visual studio is one. they use programming languages such as c# and visual basic.


State three reasons that visual basic is the most widely used programming language in the world?

Visual Basic is not the most widely used programming language in the world. Aside from anything else, it only works on Windows. Java is the most widely used programming language in the world, closely followed by C++. And there are plenty more languages that are far more widely used than Visual Basic, including C, Python, Ruby and Perl, to name but a few. Even C#, which is also a Windows-only programming language, is more popular than Visual Basic.


How do you make a program to check remainder is zero or not inGW-BASIC?

So you have a number - "Number" and you need to find if the remainder of dividing it by a number is 0. Number = 3 If Number Mod 2 = 0 then Msgbox("Remainder of 0") End If This function divides by 2 then gives the remainder, this let's you check if a number is odd or even.


What are the pros and cons of using Visual Basic on Excel?

Excel has a variation of Visual BASIC built into it, called Visual BASIC for Applications, commonly called VBA. The advantage of using VBA is that it greatly enhances what you can do with Excel. It gives you greater power to do things with Excel that are difficult or impossible with Excel formulas. It can help automate tasks by creating simple macros. It brings the powers of programming to Excel.The main disadvantage is the complexity of VBA if you are not familiar with it. It takes time to learn how to use it, and even then it can be complicated to get it to do what you want. If you have knowledge of Visual BASIC that will help, but there are aspects of VBA that are especially for working with Excel. There is the danger to ruining your data if you do something wrong with VBA.


Is Quicken Deluxe complicated?

"Quicken Deluxe has a number of advanced features that can be very complicated to use, however, the basic functionality of the software is quite intuitive and the program can be used basically quite simply by even novice users."