COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What data type would you use for storing the number of students in a class?
A
boolean
B
String
C
double
D
int
Explanation: 

Detailed explanation-1: -A) A number of children at your school: We will use here long int as the data type since the number of children can be less or more depends on the school and it will be always in positive numbers so long int is the better option.

Detailed explanation-2: -An integer type variable can store zero, positive, and negative values without any decimal. In C language, the integer data type is represented by the ‘int’ keyword, and it can be both signed or unsigned. By default, the value assigned to an integer variable is considered positive if it is unsigned.

Detailed explanation-3: -int. The int data type is used for storing integer value.

Detailed explanation-4: -The int data type is the primary integer data type in SQL Server. The bigint data type is intended for use when integer values might exceed the range that is supported by the int data type.

There is 1 question to complete.