11
QUESTIONS AND ANSWERS DATA TYPES AND DIRECTIVES Submitted By: TANUJ KUMAR SID: 12104025 Submitted to: PROF. TILAK THAKUR

Questions and Answers Data Types and Directives 8051 C++ C

Embed Size (px)

DESCRIPTION

Questions and Answers Data Types and Directives 8051 C++ C

Citation preview

Page 1: Questions and Answers Data Types and Directives 8051 C++ C

QUESTIONS AND ANSWERS DATA TYPES

AND DIRECTIVESSubmitted By: TANUJ KUMAR

SID: 12104025Submitted to: PROF. TILAK THAKUR

Page 2: Questions and Answers Data Types and Directives 8051 C++ C

What is the use of define byte?• The DB directive is the most widely used data directive in the

assembler. It is used to define the 8-bit data. When DB is used to define data, the numbers can be in decimal, binary, hex, or ASCII formats. For decimal, the “D” after the decimal number is optional, but using “B” (binary) and “H” (hexadecimal) for the others is required.

Page 3: Questions and Answers Data Types and Directives 8051 C++ C

Which of the following is NOT an Integer?A. CharB. ByteC. IntegerD. ShortE. Long

Ans. A

Page 4: Questions and Answers Data Types and Directives 8051 C++ C

What is the size of a Decimal?A. 4 byteB. 8 byteC. 16 byteD. 32 byte

Ans. C

Page 5: Questions and Answers Data Types and Directives 8051 C++ C

The ______ directive is used to indicate the beginning of the address. ______ directive indicates to the assembler the end of the source (asm) file.

Ans. ORG (Origin) directiveEND directive

Page 6: Questions and Answers Data Types and Directives 8051 C++ C

The fundamental (or built-in or primitive) data types are:• Integer• Floating Point• _________• _________• Bool

Ans. 1. Character2. Double

Page 7: Questions and Answers Data Types and Directives 8051 C++ C

Which of the following statements are correct?1. We can assign values of any type to variables of type object.2. When a variable of a value type is converted to object, it is said to be

unboxed.3. When a variable of type object is converted to a value type, it is said to be

boxed.4. Boolean variable cannot have a value of null.5. When a value type is boxed, an entirely new object must be allocated and

constructed.

Ans. 1,5

Page 8: Questions and Answers Data Types and Directives 8051 C++ C

TYPE SIZE(bytes)

RANGE

SHORT 2 -32768 to 32767

UNSIGNED SHORT 2 0 to 65,535

SIGNED SHORT 2 Same as short

INT 2 -32768 to 32767

UNSIGNED INT 2 0 to 65,535

SIGNED INT 2 Same as int

LONG 4 -2,147,483,648 TO 2,147,483,647

UNSIGNED LONG 4 0 to 4,294,967,295

SIGNED LONG 4 Same as long

Ans. 2 bytes Range -32768

to 32767

Page 9: Questions and Answers Data Types and Directives 8051 C++ C

Which of the following does not store a sign?A. ShortB. IntegerC. LongD. ByteE. Single

Ans. D

Page 10: Questions and Answers Data Types and Directives 8051 C++ C

______ data type is similar to the floating-point data type but it has an even greater range extending up to 10308Also write its syntax?

Ans. Double data type Syntax= double variable-name;

Page 11: Questions and Answers Data Types and Directives 8051 C++ C

_______ data type will only accept two values: true(1) or false(0).

Ans. Boolean Type (bool)