Monday, January 17, 2011

Differentiate between data type; Boolean,integer,double,string and date

DATA TYPES

DESCRIPTION

DECLARATION

Boolean

consists either a True or False value. Programmers usually use it to store status.

Const Input_Status = true

or

Dim Input_status As Boolen

Input Status = False

Integer

contains any whole number value that does not have any fractional part.

Const year_birth = 1998

or

Dim age As Integer

Age = 17

Double

Any number value that may and could contain a fractional part.

Const PI = 3.142

or

Dim Marks As Double

Marks = 60.5

String

contains a sequence of characters

Const Name = “CHOO”

or

Dim Address As String

Address = “Kuala Lumpur

Date

Contain date and time value

Example: 7/8/91, 12:28 AM

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.