FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

PROGRAMMING LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which Data Type is used to store whole numbers?
A
String
B
Double
C
Integer
D
Boolean
Explanation: 

Detailed explanation-1: -The INTEGER data type stores whole numbers that range from-2, 147, 483, 647 to 2, 147, 483, 647 for 9 or 10 digits of precision. The number 2, 147, 483, 648 is a reserved value and cannot be used. The INTEGER value is stored as a signed binary integer and is typically used to store counts, quantities, and so on.

Detailed explanation-2: -int data type This data type can store whole numbers from-2147483648 to 2147483647. Generally, int is the preferred data type when you create variables with a numeric value.

Detailed explanation-3: -Computers use a fixed number of bits to represent an integer. The commonly-used bit-lengths for integers are 8-bit, 16-bit, 32-bit or 64-bit.

Detailed explanation-4: -Integers are commonly stored using a word of memory, which is 4 bytes or 32 bits, so integers from 0 up to 4, 294, 967, 295 (232-1) can be stored. Below are the integers 1 to 5 stored as four-byte values (each row represents one integer).

There is 1 question to complete.