TCS NQT Data Types Quiz-1

Question 1

Time: 00:00:00
Neelam wants to share her code with a colleague, who may modify it. Thus she wants to include the date of the program creation, the author and other she wants to include the date of the program creation, the author and other information with the program. What component should she use?

header files

header files

Iteration

Iteration

Comments

Comments

pre processor

pre processor

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

c

She want to use comments in the program.

c

c

c

c

C

C

Start

Question 2

Time: 00:00:00
What is the output of the following code statements? The compiler saves the first integer at the memory location 4165 and the rest at consecutive memory spaces in order of declaration. Integer is one byte long.
integer a
pointer c, d
a = 30c = &a
c = &a
d = c
a = a + 10
print *c

30

30

40

40

4165

4165

4166

4166

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

option b: is correct

&a = 4165 //given a = 30, c = &a = 4165 // 3rd line c = &a = 4165 //(again) 4th line d = c = 4165 // 5th line a = a+10 = 40 // 6th line print *c = *(4165) = 40 // 7th line /* . so finally answer is (B) 40 . there is one mistake in this question, question should be in this format... . */ integer a pointer c, d a = 30 c = &a d = c a = a + 10 print *c

its 4165

30

they asked us to print *c which means value not address of pointer.so c points to a value which is first 30 and after increment 40

here initially the value of a is 30 and c store a\'s address now if we update the value of a new value of c is updated.

option b is correct beacuse c refer to a ultimately.

option b is correct beacuse c refer to a ultimately.

Start

Question 3

Time: 00:00:00
A data type is stored as a 6 bit signed integer. Which of the following cannot be represented by this data type?

-12

-12

6

6

18

18

32

32

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

For signed integer one bit is reserved for sign and the range is -32 to 31 .Option 3 is correct ie 32 can not be represented in this data type.

Ok let\'s start calculation. 6 bits means total combinations of bits are 2^6 = 64. Now values up to 63 you can store including 0. But your data type is signed means -32 to +31 you may store which is exactly 64 combinations. Now come to the question, you can not store: 32 .

Ok let\'s start calculation. 6 bits means total combinations of bits are 2^6 = 64. Now values up to 63 you can store including 0. But your data type is signed means -32 to +31 you may store which is exactly 64 combinations. Now come to the question, you can not store: 32 .

32 option c

D

32 or 64

Start

Question 4

Time: 00:00:00
A language has 28 different letters in total. Each word in the language iscomposed of maximum 7 letters. You want to create a data-type to store a word ofthis language. You decide to store the word as an array of letters. How many bytes will you assign to the data-type to be able to store all kinds of words of the language.

7

7

75

75

28

28

196

196

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

This may be the answer you seek: 1 bit -> 2 possible states 2 bits -> 4 possible states 3 bits -> 8 possible states 4 bits -> 16 possible states 5 bits -> 32 possible states (I hope you see the pattern here) You need 5 bits to represent all possible letters in the language (28 > 16 & 28 < 32). Since you are told you are storing an array of letters, you will need a total of 5*7 bits = 35 bits to represent all words in the language. (You actually need 29 symbols per array element, not 28, since you need a \'null\' symbol to signify shorter than 7 letter words, but that doesn\'t change the answer.) Now, in reality no sane person would actually do this in practice on a real computer. They would just store 7 bytes (or possibly 8, for a terminating null character (C-style string) to simplify processing.)

7

C

Start

Question 5

Time: 00:00:00
A 10-bit unsigned integer has the following range:

0 to 1000

0 to 1000

0 to 1024

0 to 1024

0 to 1023

0 to 1023

0 to 1025

0 to 1025

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

pow(2,n)=pow(2,10)=> 0 to 1023

A

Start

Question 6

Time: 00:00:00
Parul takes as input two numbers: a and b. a and b can take integer valuesbetween 0 and 255. She stores a, b and c as 1-byte data type. She writes the following code statement to process a and b and put the result in c.
c = a + 2*b
To her surprise her program gives the right output with some input values of a and b, while gives an erroneous answer for others. For which of the following inputs will it give a wrong answer?

a = 200 b = 10

a = 200 b = 10

a = 10 b = 200

a = 10 b = 200

a = 50 b = 100

a = 50 b = 100

a = 100 b = 50

a = 100 b = 50

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

c=10+2*200=410>(0-255)

B

answer is B.a=10 b=200 so c became 410 which is greater than 255

answer is B.a=10 b=200 so c became 410 which is greater than 255

Start

Question 7

Time: 00:00:00
Which is used to convert source code to target language

Linker

Linker

Loader

Loader

Executer

Executer

Compiler

Compiler

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

D

Linker a program used with a compiler or assembler to provide links to the libraries needed for an executable program. Loader A loader is a major component of an operating system that ensures all necessary programs and libraries are loaded, which is essential during the startup phase of running a program. It places the libraries and programs into the main memory in order to prepare them for execution.

Start

Question 8

Time: 00:00:00
Tricha wants to store a list of binary data.Which of following data types should she use?

Boolean

Boolean

Integer

Integer

Character

Character

Boolean

Boolean

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Answers A and D are the same

B

Start

Question 9

Time: 00:00:00
Which of the following options is an exception to being a part of composite data types?

Union

Union

Structure

Structure

Arrays

Arrays

Stacks

Stacks

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

C

Start

["0","40","60","80","100"]
["Need more practice! \r\n \r\n \r\n","Keep trying! \r\n \r\n \r\n","Not bad! \r\n \r\n \r\n","Good work! \r\n \r\n \r\n","Perfect! \r\n \r\n \r\n"]

Buy TCS NQT Paid Materials

Paid Materials TCS NQT

Join TCS NQT Online Classes

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/0

Accuracy

0%

Comments

One comment on “TCS NQT Data Types Quiz-1”