Page 156 - DCAP507_SYSTEM_SOFTWARE
P. 156
System Software
Notes 4. .......................... language is suitable for expressing formulae, writing equations, and
performing iterative calculations.
10.3 Data Types
10.3.1 Primitive Data Types
The kind of data that variables may hold is called as Data type. There are four basic data types
used in both languages:
Data Types
Pascal C
(i) char char
(ii) integer int
(iii) real float
(iv) boolean double
1. char a character
2. int an integer, in the range -32,767 to 32,767
3. long int a larger integer (up to +-2,147,483,647)
4. float a floating-point number
5. double a floating-point number, with more precision and perhaps greater range than
float.
The type char
This type is defined as the set of characters available for the language. A particular value of type
char is denoted by enclosing the characters in single quotes.
For example,
'A', '4', '+', '?'
The type int
This type represents any positive and negative number without a decimal point.
For example,
5, -25, -67, 100005
The type real & float
This type allows any signed or unsigned numbers having a decimal point.
For example,
10.367, -0.893, +2., 25.0,
150 LOVELY PROFESSIONAL UNIVERSITY