Introduction to Computer and Programming concept Set 1

Online MCQ Assignment Answer

 

QN1: Prior to using a pointer variable it should be

a. declared

b. initialized

c. both declared and initialized

d. none of these

Answer

Answer: c. both declared and initialized

QN2: For ‘C’ programming language

a. constant expressions are evaluated at compile time

b. string constants can be concatenated at compile time

c. size of aray should be known at compile time

d. all of these

Answer

Answer: b. string constants can be concatenated at compile time

QN3: “What does the “”auto”” specifier do?”

a. It automatically initializes a variable to 0;.

b. It indicates that a variable’s memory will automatically be preserved.

c. It automatically increments the variable when used

d. It indicates that a variable’s memory space is allocated upon entry into the block.

Answer

Answer: b. It indicates that a variable’s memory will automatically be preserved.

QN4: Which of the following is the 1’s complement of 10?

a. 1

b. 110

c. 0

d. 11

Answer

Answer: a. 1

QN5: Which of the following special symbol allowed in a variable name?

a. * (asterisk)

b. | (pipeline)

c. – (hyphen)

d. _ (underscore)

Answer

Answer: d. _ (underscore)

QN6: What will you do to treat the constant 3.14 as a float?

a. use float(3.14f)

b. use 3.14f

c. use f(3.14)

d. use (f)(3.14)

Answer

Answer: b. use 3.14f

QN7: Which of the following cannot be checked in a switch-case statement?

a. Character

b. interger

c. float

d. enum

Answer

Answer: c. float

QN8: Which file executed commands in DOS

a. MS-DOS.SYS

b. CONFIG.SYS

c. COMMAND.COM

d. SYSTEM.INI

Answer

Answer: c. COMMAND.COM

QN9: What is the purpose of fflush() function.

a. flushes all streams and specified streams

b. flushes only specified stream

c. flushes input/output buffer.

d. flushes file buffer.

Answer

Answer: a. flushes all streams and specified streams

QN10: Which two commands enable you to move between directories

a. CD

b. CHDIR

c. MOVE

d. MOVE DIR

Answer

Answer: a. CD

QN11: For the conversion of a integer decimal number to its binary equivalent we need to divide that number by ___

a. 10

b. 2

c. 8

d. 4

Answer

Answer: b. 2

QN12: “For a loop in a C program ,if the condition is missing”

a. it is assumed to be present and taken to be false

b. it is assumed to be present and taken to be true

c. it result in a syntax error

d. execution will be terminated abruptly

Answer

Answer: b. it is assumed to be present and taken to be true

QN13: “A computer cannot “”boot”” if it does not have the”

a. compiler

b. loader

c. assembler

d. Operating System

Answer

Answer: d. Operating System

QN14: Accessing records from a file directly without searching from the beginning of the file is

a. Random Access

b. Direct Access

c. High Access

d. Sharing

Answer

Answer: b. Direct Access

QN15: Memories in which any location can be reached in a fixed (and short) amount of time after specifying its address is called

a. sequential-access memory

b. secondary memory

c. random-access memory

d. mass storage

Answer

Answer: c. random-access memory

QN16: Which of the following statement is (are) correct?

a. enum variables can be assigned new values

b. enum variables can be compared

c. enumeration feature does not increase the power of C

d. all of these

Answer

Answer: d. all of these

QN17: What does the disk drive of a computer do?

a. Rotate the disk

b. Read the disk

c. Load a program from the disk into the memory

d. Both b and c

Answer

Answer: d. Both b and c

QN18: Definition of pointer is

a. A keyword used to create variables

b. A variable that stores address of an instruction

c. A variable that stores address of other variable

d. A constant

Answer

Answer: c. A variable that stores address of other variable

QN19: Function putchar() displays

a. one word at a time on the screen

b. one character at a time

c. result on the screen

d. None of the above

Answer

Answer: b. one character at a time

QN20: int y[4] = {6, 7, 8, 9};

int *ptr = y + 2;printf(“%dn”, ptr[ 1 ] );

What is printed when the sample code above is executed?

a. 6

b. 7

c. 8

d. 9

Answer

Answer: d. 9

QN21: What is the BCD code for binary number (10111).

a. 0010 0011

b. 0011 1000

c. 111111

d. 100101

Answer

Answer: a. 0010 0011

QN22: “The declaration “”unsigned u”” indicates u is a/an”

a. unsigned character

b. unsigned integer

c. character

d. none of these

Answer

Answer: b. unsigned integer

QN23: How many digits are required for a Decimal number system?

a. 7

b. 8

c. 9

d. 10

Answer

Answer: d. 10

QN24: The libraray function exit() causes an exit from

a. the loop in which it occurs

b. the block in which it occurs

c. the function in which it occurs

d. This function causes immediate termination of the entire program

Answer

Answer: d. This function causes immediate termination of the entire program

QN25: Which of the following is an application software?

a. MS-Office

b. Unix

c. Linux

d. Solar

Answer

Answer: a. MS-Office

QN26: The brain of any computer system is

a. ALU

b. CPU

c. Memory

d. Control Unit

Answer

Answer: b. CPU

QN27: “According to the Standard C specification, what are the respective minimum sizes (in bytes) of the following three data types: short; int; and long?”

a. “1, 2, 2”

b. “1, 2, 4”

c. “1, 2, 8”

d. “2, 2, 4”

Answer

Answer: d. “2, 2, 4”

QN28: It is necessary to declare the type of a function in the calling program if the function

a. returns an integer

b. returns non-integer value

c. is not defined in the same file

d. none of these

Answer

Answer: b. returns non-integer value

QN29: The sqrt() function is available on

a. conio.h

b. string.h

c. math.h

d. graphic.h

Answer

Answer: c. math.h

QN30: How is a variable accessed from another file?

a. The global variable is referenced via the extern specifier

b. The global variable is referenced via the auto specifier.

c. The global variable is referenced via the global specifier.

d. The global variable is referenced via the pointer specifier.

Answer

Answer: a. The global variable is referenced via the extern specifier

QN31: A computer program that instructs other programs to perform a particular type of operation is

a. System Software

b. Application Software

c. Compiler

d. Interpreter

Answer

Answer: a. System Software

QN32: “Which of the following are unary operators in C? !, sizeof, ~, &&”

a. “!, sizeof”

b. “!, ~”

c. “sizeof, &&”

d. “!, sizeof, ~”

Answer

Answer: d. “!, sizeof, ~”

QN33: Integer division in a ‘C’ program results in

a. truncation

b. rounding

c. overflow

d. none of these

Answer

Answer: a. truncation

QN34: Default initial value of static is

a. garbage

b. 0

c. 1

d. 2

Answer

Answer: b. 0

QN35: Which one of the following provides conceptual support for function calls?

a. The system stack

b. The data segment

c. The processor’s registers

d. The heap

Answer

Answer: a. The system stack

QN36: The value of an automatic variable that is declared but not initialized will be

a. 0

b. 1

c. garbage

d. none of these

Answer

Answer: c. garbage

QN37: “A “”switch”” statement is used to”

a. switch between fuctions in a program

b. switch from one variable to another variable

c. to choose from multiple possiblities which may arise due to different values of a single variable

d. to use switch variables

Answer

Answer: c. to choose from multiple possiblities which may arise due to different values of a single variable

QN38: What is the decimal equivalent of the binary number (11111)

a. 27

b. 29

c. 31

d. 33

Answer

Answer: c. 31

QN39: The getch() library function returns

a. a character when any key is pressed

b. a character when enter is pressed

c. and displays a character on the screen when any key is pressed

d. none of these

Answer

Answer: d. none of these

QN40: “What is the similarity between a structure, union and enumeration?”

a. All of them let you define new values

b. All of them let you define new data types

c. All of them let you define new pointers

d. All of them let you define new structure

Answer

Answer: b. All of them let you define new data types

ed010d383e1f191bdb025d5985cc03fc?s=120&d=mm&r=g

DistPub Team

Distance Publisher (DistPub.com) provide project writing help from year 2007 and provide writing and editing help to hundreds student every year.