Question 1 of 72Introduction to C programming
Which of the following is NOT a valid C token category?
AKeyword
BIdentifier
CClass
DOperator
Answer is hidden
Question 2 of 72Introduction to C programming
Which loop is exit-controlled (executes at least once)?
Afor
Bwhile
Cdo-while
Dif-else
Answer is hidden
Question 3 of 72Introduction to C programming
The default parameter passing mechanism in C is:
ACall by reference
BCall by value
CCall by address only
DCall by name
Answer is hidden
Question 4 of 72Introduction to C programming
A recursive function must always have a:
ALoop
BPointer
CBase case
DGlobal variable
Answer is hidden
Question 5 of 72Introduction to C programming
Which function is used for unformatted single-character input?
Ascanf()
Bgetchar()
Cprintf()
Dgets()
Answer is hidden
Question 6 of 72Introduction to C programming
A string in C is terminated by:
AA space
BThe character '\0'
CA newline only
DEnd of file marker
Answer is hidden
Question 7 of 72Introduction to C programming
In the declaration int a[3][4], the array has:
A3 elements
B4 elements
C12 elements arranged as 3 rows and 4 columns
D7 elements
Answer is hidden
Question 8 of 72Introduction to C programming
Which statement skips the remaining code in the current loop iteration and moves to the next?
Abreak
Bcontinue
Cgoto
Dreturn
Answer is hidden
Question 9 of 72Introduction to C programming
Which of these is an exit-controlled feature unique to switch-case (if break is omitted)?
AInfinite loop
BFall-through to the next case
CCompile error
DAutomatic exit
Answer is hidden
Question 10 of 72Introduction to C programming
The strcmp() function from string.h is used to:
ACopy one string to another
BConcatenate two strings
CCompare two strings
DReverse a string
Answer is hidden
Question 11 of 72Pointers, structure and data files in C programming
The & operator in C is used to obtain a variable's:
AValue
BAddress
CData type
DSize
Answer is hidden
Question 12 of 72Pointers, structure and data files in C programming
If int *p; and p currently points to an int, then p++ moves p forward by:
A1 byte
Bsizeof(int) bytes
Csizeof(char) bytes
DIt does not move
Answer is hidden
Question 13 of 72Pointers, structure and data files in C programming
The expression *(a + i) is equivalent to:
Aa[i]
Ba[i+1]
Ci[a]
DBoth a[i] and i[a]
Answer is hidden
Question 14 of 72Pointers, structure and data files in C programming
In a union, the total memory allocated equals:
ASum of sizes of all members
BSize of the largest member
CSize of the smallest member
DAlways 4 bytes
Answer is hidden
Question 15 of 72Pointers, structure and data files in C programming
Which file opening mode creates a new file for writing, overwriting if it already exists?
Answer is hidden
Question 16 of 72Pointers, structure and data files in C programming
Which function is used for random access to a file?
Afprintf()
Bfseek()
Cfclose()
Dfgets()
Answer is hidden
Question 17 of 72Pointers, structure and data files in C programming
Passing a structure to a function by reference is done using a:
ACopy of the structure
BStructure pointer
CUnion
DGlobal array only
Answer is hidden
Question 18 of 72Pointers, structure and data files in C programming
fread() and fwrite() operate on files in:
AText mode only
BBinary mode
CCompressed mode
DAppend mode only
Answer is hidden
Question 19 of 72Pointers, structure and data files in C programming
An array of structures is used to:
AStore one record only
BStore multiple records of the same structure type
CReplace unions
DAvoid using pointers
Answer is hidden
Question 20 of 72Pointers, structure and data files in C programming
Which statement about structures is TRUE?
AAll members share one memory location
BEach member gets its own memory
COnly one member can be valid at a time
DStructures cannot contain arrays
Answer is hidden
Question 21 of 72C++ language constructs with objects and classes
Function overloading is an example of:
ARuntime polymorphism
BCompile-time polymorphism
CInheritance
DEncapsulation
Answer is hidden
Question 22 of 72C++ language constructs with objects and classes
The inline keyword is a request to the compiler to:
AAllocate memory dynamically
BSubstitute the function code at the call site
CDelay function execution
DMake the function virtual
Answer is hidden
Question 23 of 72C++ language constructs with objects and classes
Which access specifier allows access from the class and its derived classes only?
Aprivate
Bpublic
Cprotected
Dfriend
Answer is hidden
Question 24 of 72C++ language constructs with objects and classes
A constructor that takes no parameters is called a:
ACopy constructor
BParameterized constructor
CDefault constructor
DDestructor
Answer is hidden
Question 25 of 72C++ language constructs with objects and classes
ACan be overloaded
BTakes arguments
CHas the same name as the class prefixed with ~
DReturns an int
Answer is hidden
Question 26 of 72C++ language constructs with objects and classes
Dynamic memory for a single object in C++ is allocated using:
Amalloc()
Bnew
Calloc()
Dcalloc()
Answer is hidden
Question 27 of 72C++ language constructs with objects and classes
The 'this' pointer refers to:
AThe base class object
BThe current object on which the member function is called
CA static member
DThe next object in an array
Answer is hidden
Question 28 of 72C++ language constructs with objects and classes
A static data member of a class:
AHas a separate copy for every object
BIs shared by all objects of the class
CCannot be initialized
DIs only visible inside main()
Answer is hidden
Question 29 of 72C++ language constructs with objects and classes
A friend function of a class can:
AOnly access public members
BAccess the class's private and protected members
CNever be defined outside the class
DOnly be a member function
Answer is hidden
Question 30 of 72C++ language constructs with objects and classes
Passing an argument by reference (using &) mainly helps to:
AAlways create a copy
BAvoid copying and allow modification of the original
CIncrease compilation time only
DPrevent function calls
Answer is hidden
Question 31 of 72Features of object-oriented programming
Operator overloading in C++ is implemented using the keyword:
Avirtual
Boperator
Cfriend
Dstatic
Answer is hidden
Question 32 of 72Features of object-oriented programming
Overloading the unary minus (-) operator affects an operator with:
ATwo operands
BOne operand
CThree operands
DNo operand
Answer is hidden
Question 33 of 72Features of object-oriented programming
Converting a class object to a basic data type is done using a:
ACopy constructor
BConversion (casting) operator function
CDestructor
DFriend class
Answer is hidden
Question 34 of 72Features of object-oriented programming
When a class inherits from two or more base classes, this is called:
ASingle inheritance
BMultilevel inheritance
CMultiple inheritance
DHierarchical inheritance
Answer is hidden
Question 35 of 72Features of object-oriented programming
A โ B โ C, where C is derived from B and B is derived from A, illustrates:
AHierarchical inheritance
BMultilevel inheritance
CHybrid inheritance
DMultiple inheritance
Answer is hidden
Question 36 of 72Features of object-oriented programming
Several derived classes inheriting from a single common base class describes:
AMultilevel inheritance
BHierarchical inheritance
CMultiple inheritance
DMultipath inheritance
Answer is hidden
Question 37 of 72Features of object-oriented programming
In inheritance, which constructor executes FIRST when a derived object is created?
ADerived class constructor
BBase class constructor
CBoth simultaneously
DNeither runs automatically
Answer is hidden
Question 38 of 72Features of object-oriented programming
The order in which destructors execute in inheritance is:
ABase class first, then derived
BDerived class first, then base
CRandom order
DOnly base class destructor runs
Answer is hidden
Question 39 of 72Features of object-oriented programming
Diamond/multipath inheritance ambiguity is resolved by declaring the common base as a:
Astatic class
Bfriend class
Cvirtual base class
Dabstract class
Answer is hidden
Question 40 of 72Features of object-oriented programming
A combination of hierarchical and multiple inheritance is an example of:
ASingle inheritance
BHybrid inheritance
CMultilevel inheritance
DNo inheritance
Answer is hidden
Question 41 of 72Pure virtual function and file handling
A pure virtual function is declared as:
Avirtual void fn();
Bvirtual void fn() = 0;
Cvoid fn() = virtual;
Dstatic void fn() = 0;
Answer is hidden
Question 42 of 72Pure virtual function and file handling
A class containing at least one pure virtual function is called a/an:
AFriend class
BAbstract class
CStatic class
DFinal class
Answer is hidden
Question 43 of 72Pure virtual function and file handling
Runtime polymorphism in C++ is achieved primarily through:
AFunction overloading
BOperator overloading
CVirtual functions
DDefault arguments
Answer is hidden
Question 44 of 72Pure virtual function and file handling
Which class is the base of the entire C++ stream class hierarchy?
Aiostream
Bios
Cfstream
Distream
Answer is hidden
Question 45 of 72Pure virtual function and file handling
Which class is used specifically to read data from a file?
Aofstream
Bifstream
Ciostream
Dsstream
Answer is hidden
Question 46 of 72Pure virtual function and file handling
Which member function checks whether the end of a file has been reached?
Afail()
Beof()
Cgood()
Dbad()
Answer is hidden
Question 47 of 72Pure virtual function and file handling
Which manipulator inserts a newline and flushes the output buffer?
Asetw()
Bendl
Csetprecision()
Dflush() only
Answer is hidden
Question 48 of 72Pure virtual function and file handling
setw() is used to set the:
AFill character
BDecimal precision
CField width for the next output
DFile open mode
Answer is hidden
Question 49 of 72Pure virtual function and file handling
Dynamic binding means the function call is resolved:
AAt compile time
BAt run time, based on the actual object type
CNever resolved
DBy the linker only
Answer is hidden
Question 50 of 72Pure virtual function and file handling
Which class supports both reading and writing to a file?
Aifstream
Bofstream
Cfstream
Dios
Answer is hidden
Question 51 of 72Generic programming and exception handling
A function template in C++ is declared using the keyword combination:
Aclass template
Btemplate<class T>
Cgeneric<T>
Dtypename function
Answer is hidden
Question 52 of 72Generic programming and exception handling
Which of these is NOT one of the three main components of the STL?
AContainers
BAlgorithms
CIterators
DCompilers
Answer is hidden
Question 53 of 72Generic programming and exception handling
Which STL container stores elements in a dynamic, resizable array?
Answer is hidden
Question 54 of 72Generic programming and exception handling
In C++ exception handling, the block of code that might raise an exception is placed inside:
Aa catch block
Ba try block
Ca throw block
Da template block
Answer is hidden
Question 55 of 72Generic programming and exception handling
Which keyword is used to signal that an exceptional condition has occurred?
Answer is hidden
Question 56 of 72Generic programming and exception handling
ACatch only integer exceptions
BCatch any type of exception
CRethrow an exception
DDeclare a function template
Answer is hidden
Question 57 of 72Generic programming and exception handling
Rethrowing an exception from within a catch block is done using:
Athrow; (with no operand)
Breturn;
Ccatch();
Dretry;
Answer is hidden
Question 58 of 72Generic programming and exception handling
A single try block can be followed by:
AOnly one catch block
BMultiple catch blocks for different exception types
CNo catch block at all
DOnly a throw statement
Answer is hidden
Question 59 of 72Generic programming and exception handling
If no catch block matches a thrown exception, the program calls:
Amain() again
Bterminate()
Crestart()
Ddelete()
Answer is hidden
Question 60 of 72Generic programming and exception handling
An iterator in the STL is best described as:
AA sorting algorithm
BA pointer-like object used to traverse container elements
CA type of exception
DA class template only for maps
Answer is hidden
Question 61 of 72Computer Architecture & Hardware
When an interrupt occurs, the CPU transfers execution to:
AInterrupt Service Routine (ISR)
BMain program counter
CStack pointer
DAccumulator
Answer is hidden
Question 62 of 72Computer Architecture & Hardware
The 8086 microprocessor operates in which two modes?
AReal mode and Protected mode
BMinimum mode and Maximum mode
CUser mode and Kernel mode
DSingle-bus and Multi-bus mode
Answer is hidden
Question 63 of 72Computer Architecture & Hardware
Assembly language source code is translated to machine code by:
AAssembler
BCompiler
CInterpreter
DLinker
Answer is hidden
Question 64 of 72Computer Architecture & Hardware
The 8255 Programmable Peripheral Interface (PPI) provides which type of interface?
APhysical
BLogical
CSerial
DOptical
Answer is hidden
Question 65 of 72Computer Architecture & Hardware
RISC (Reduced Instruction Set Computer) architecture is characterized by:
AComplex variable-length instructions and small register file
BLarge number of registers, fixed instruction size, and pipelining
CMicrocode-based execution and many addressing modes
DSlow clock speed and large instruction cache
Answer is hidden
Question 66 of 72Computer Architecture & Hardware
What does the Address Generation Unit (AGU) in a CPU do?
AExecutes floating-point operations
BComputes effective memory addresses
CManages cache replacement
DDecodes instruction opcodes
Answer is hidden
Question 67 of 72Computer Architecture & Hardware
Pipelining in CPU design is also known as:
AParallel processing
BMultiprogramming
CAssembly-line operation / Instruction overlapping
DSuperscalar execution
Answer is hidden
Question 68 of 72Computer Architecture & Hardware
How many signal wires does the IยฒC (Inter-Integrated Circuit) bus use?
Answer is hidden
Question 69 of 72Computer Architecture & Hardware
A microprocessor fetches its next instruction from:
ACache memory
BRegister file
CMain memory (RAM)
DAccumulator
Answer is hidden
Question 70 of 72Computer Architecture & Hardware
In an SPI bus running at 5 MHz with 8-bit frames, what is the time taken per bit?
A0.02 ฮผs
B0.2 ฮผs
C2 ฮผs
D20 ฮผs
Answer is hidden
Question 71 of 72Computer Architecture & Hardware
Which circuit inside the CPU performs arithmetic and logical operations?
AControl Unit
BALU
CRegister File
DMemory Controller
Answer is hidden
Question 72 of 72Computer Architecture & Hardware
In floating-point multiplication, the correct sequence of operations is:
AAdd exponents, multiply mantissas, then normalize and round
BMultiply exponents, add mantissas, then normalize
CSubtract exponents, multiply mantissas, then normalize
DMultiply mantissas, multiply exponents, then round
Answer is hidden