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: c. both declared and initializedAnswer
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: b. string constants can be concatenated at compile timeAnswer
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: b. It indicates that a variable’s memory will automatically be preserved.Answer
QN4: Which of the following is the 1’s complement of 10?
a. 1
b. 110
c. 0
d. 11
Answer: a. 1Answer
QN5: Which of the following special symbol allowed in a variable name?
a. * (asterisk)
b. | (pipeline)
c. – (hyphen)
d. _ (underscore)
Answer: d. _ (underscore)Answer
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: b. use 3.14fAnswer
QN7: Which of the following cannot be checked in a switch-case statement?
a. Character
b. interger
c. float
d. enum
Answer: c. floatAnswer
QN8: Which file executed commands in DOS
a. MS-DOS.SYS
b. CONFIG.SYS
c. COMMAND.COM
d. SYSTEM.INI
Answer: c. COMMAND.COMAnswer
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: a. flushes all streams and specified streamsAnswer
QN10: Which two commands enable you to move between directories
a. CD
b. CHDIR
c. MOVE
d. MOVE DIR
Answer: a. CDAnswer
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: b. 2Answer
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: b. it is assumed to be present and taken to be trueAnswer
QN13: “A computer cannot “”boot”” if it does not have the”
a. compiler
b. loader
c. assembler
d. Operating System
Answer: d. Operating SystemAnswer
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: b. Direct AccessAnswer
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: c. random-access memoryAnswer
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: d. all of theseAnswer
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: d. Both b and cAnswer
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: c. A variable that stores address of other variableAnswer
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: b. one character at a timeAnswer
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: d. 9Answer
QN21: What is the BCD code for binary number (10111).
a. 0010 0011
b. 0011 1000
c. 111111
d. 100101
Answer: a. 0010 0011Answer
QN22: “The declaration “”unsigned u”” indicates u is a/an”
a. unsigned character
b. unsigned integer
c. character
d. none of these
Answer: b. unsigned integerAnswer
QN23: How many digits are required for a Decimal number system?
a. 7
b. 8
c. 9
d. 10
Answer: d. 10Answer
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: d. This function causes immediate termination of the entire programAnswer
QN25: Which of the following is an application software?
a. MS-Office
b. Unix
c. Linux
d. Solar
Answer: a. MS-OfficeAnswer
QN26: The brain of any computer system is
a. ALU
b. CPU
c. Memory
d. Control Unit
Answer: b. CPUAnswer
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: d. “2, 2, 4”Answer
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: b. returns non-integer valueAnswer
QN29: The sqrt() function is available on
a. conio.h
b. string.h
c. math.h
d. graphic.h
Answer: c. math.hAnswer
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: a. The global variable is referenced via the extern specifierAnswer
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: a. System SoftwareAnswer
QN32: “Which of the following are unary operators in C? !, sizeof, ~, &&”
a. “!, sizeof”
b. “!, ~”
c. “sizeof, &&”
d. “!, sizeof, ~”
Answer: d. “!, sizeof, ~”Answer
QN33: Integer division in a ‘C’ program results in
a. truncation
b. rounding
c. overflow
d. none of these
Answer: a. truncationAnswer
QN34: Default initial value of static is
a. garbage
b. 0
c. 1
d. 2
Answer: b. 0Answer
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: a. The system stackAnswer
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: c. garbageAnswer
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: c. to choose from multiple possiblities which may arise due to different values of a single variableAnswer
QN38: What is the decimal equivalent of the binary number (11111)
a. 27
b. 29
c. 31
d. 33
Answer: c. 31Answer
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: d. none of theseAnswer
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: b. All of them let you define new data typesAnswer