Answer: – Selecting the proper data type is important because a variable’s data type determine the amount of memory the variable uses, and the way the variable formats and stored information. It is important to select a data type that is appropriate for a type of information that our program will work with. If we are writing a program to calculate the number of miles to a distance star we will need to variable that can hold very large number. If we writing a program that must performed thousands of intensive calculations, we want variables that can we processed quickly various data type of visual basic are as fallows –

 

Data Type

Description

Boolean Used to hold the values true or false.
Byte Holds a small number in the range 0 through 255.
Currency Store number with up to 15 digits to the left of the decimal point, and up to 4 digits to the right of the decimal point. It’s called “Currency” because math operations on variable of this data type are very accurate and suitable for calculations involving money.
Date Stores date and time information.
Double Holds double-precision floating-point number, rounded to 14 digits of accuracy.
Integer Used to store whole numbers in the range of -32,768 to +32,767.
Long  Used to store whole number in the range of approximately -2 billion to +2 billion.
Single Holds single-precision floating-point number, rounded to 6 digits of accuracy.
String Holds strings, which may consist of letters, numbers, punctuation symbols, etc.
Variant Can store any type of information.
Advertisements