Question 1 of 72Introduction to C Programming
In C, printf() and scanf() are examples of:
AUnformatted I/O functions
BFormatted I/O functions
CLooping constructs
DBitwise operators
Answer is hidden
Question 2 of 72Introduction to C Programming
A while loop is described as entry-controlled because:
AThe condition is tested after each iteration
BThe condition is tested before each iteration
CIt always executes at least once
DIt has no condition
Answer is hidden
Question 3 of 72Introduction to C Programming
A do-while loop differs from a while loop in that a do-while loop:
ANever executes the body
BAlways executes the body at least once (tests condition after)
CCannot use break
DRequires no condition
Answer is hidden
Question 4 of 72Introduction to C Programming
The break statement, when used inside a loop, causes:
AThe loop to skip to the next iteration
BImmediate exit from the nearest enclosing loop or switch
CThe program to terminate entirely
DAn infinite loop
Answer is hidden
Question 5 of 72Introduction to C Programming
A recursive function must include:
ANo parameters at all
BA base case that terminates the recursion
COnly loop statements
DGlobal variables only
Answer is hidden
Question 6 of 72Introduction to C Programming
A 2-D array in C is typically used to represent:
AA single linear list
BA matrix (rows and columns)
CA single character
DA function pointer
Answer is hidden
Question 7 of 72Introduction to C Programming
A string in C is terminated by:
AA space character
BThe null character '\0'
CA newline character only
DThe digit 0
Answer is hidden
Question 8 of 72Introduction to C Programming
Which function is used to determine the length of a C string?
Astrcpy()
Bstrlen()
Cstrcmp()
Dstrcat()
Answer is hidden
Question 9 of 72Introduction to C Programming
The continue statement inside a loop causes:
AImmediate termination of the loop
BThe remaining statements in the current iteration to be skipped, proceeding to the next iteration
CThe program to crash
DThe loop to run one extra time
Answer is hidden
Question 10 of 72Introduction to C Programming
An identifier in C refers to:
AA reserved keyword
BA user-defined name for a variable, function, or array
CA fixed numeric value
DAn operator symbol
Answer is hidden
Question 11 of 72Pointers, Structures & Data Files in C
A pointer variable in C stores:
AA copy of another variable's value
BThe memory address of another variable
CA string only
DA function name only
Answer is hidden
Question 12 of 72Pointers, Structures & Data Files in C
If p is an int pointer, incrementing p (p++) moves it by:
A1 byte always
BThe size of an int (as determined by the system)
C0 bytes
DThe size of a char always
Answer is hidden
Question 13 of 72Pointers, Structures & Data Files in C
The expression arr[i] in C is equivalent to:
A*(arr+i)
Barr*i
C&arr+i
Darr/i
Answer is hidden
Question 14 of 72Pointers, Structures & Data Files in C
Passing a pointer to a function allows the function to:
AOnly read the value, never modify it
BModify the caller's original variable directly
CNever access the variable at all
DConvert the variable to a string automatically
Answer is hidden
Question 15 of 72Pointers, Structures & Data Files in C
The key difference between a structure and a union is that in a union:
AEach member has separate memory
BAll members share the same memory location
COnly integer members are allowed
DMembers cannot be accessed at all
Answer is hidden
Question 16 of 72Pointers, Structures & Data Files in C
To access a member of a structure through a pointer, C uses the:
ADot operator (.)
BArrow operator (->)
CAmpersand operator (&) alone
DAsterisk operator (*) alone
Answer is hidden
Question 17 of 72Pointers, Structures & Data Files in C
The fopen() function in C is used to:
AClose an open file
BOpen a file and return a FILE pointer
CDelete a file
DRead a single character
Answer is hidden
Question 18 of 72Pointers, Structures & Data Files in C
Opening a file in mode "a" allows:
AOnly reading from the file
BAppending data to the end of the existing file
COverwriting the file from the beginning
DRandom access only
Answer is hidden
Question 19 of 72Pointers, Structures & Data Files in C
Random access to a file in C is achieved primarily using:
Afopen() alone
Bfseek() to move to a specific file position
Cprintf()
DA structure only
Answer is hidden
Question 20 of 72Pointers, Structures & Data Files in C
An array of structures is best described as:
AA single structure variable
BA collection of structure variables of the same type, accessed by index
CA union of different data types
DA pointer to a function
Answer is hidden
Question 21 of 72C++ Constructs with Objects & Classes
A namespace in C++ is primarily used to:
AIncrease execution speed
BGroup related identifiers and avoid name clashes
CReplace all functions with classes
DStore binary data
Answer is hidden
Question 22 of 72C++ Constructs with Objects & Classes
Function overloading allows multiple functions to share the same name if they:
AHave identical parameter lists
BHave different parameter lists (number/type)
CAre all declared static
DReturn different values only, with identical parameters
Answer is hidden
Question 23 of 72C++ Constructs with Objects & Classes
An inline function requests the compiler to:
AAlways allocate it on the heap
BSubstitute its code directly at the call site
CConvert it into a class
DIgnore its return type
Answer is hidden
Question 24 of 72C++ Constructs with Objects & Classes
A private member of a class is accessible from:
AAnywhere in the program
BOnly within the class itself
COnly derived classes
DOnly friend functions of other classes
Answer is hidden
Question 25 of 72C++ Constructs with Objects & Classes
A constructor is a special member function that is:
ACalled manually whenever needed
BAutomatically called when an object is created, to initialize it
CAutomatically called when the program ends
DUsed only for static members
Answer is hidden
Question 26 of 72C++ Constructs with Objects & Classes
A destructor differs from a constructor in that a destructor:
ACan be overloaded like a constructor
BTakes no parameters and there is only one per class
CIs called multiple times per object
DCannot release resources
Answer is hidden
Question 27 of 72C++ Constructs with Objects & Classes
The 'this' pointer inside a non-static member function points to:
AThe class definition itself
BThe object on which the member function was called
CA static member only
DNothing; it is always null
Answer is hidden
Question 28 of 72C++ Constructs with Objects & Classes
A static data member of a class is:
AUnique to each object
BShared by all objects of the class (one copy total)
CNever initialized
DAccessible only via a friend function
Answer is hidden
Question 29 of 72C++ Constructs with Objects & Classes
A constant member function guarantees that it will:
AModify the object's data members freely
BNot modify the object's data members
CAlways return a constant integer
DBe callable only from derived classes
Answer is hidden
Question 30 of 72C++ Constructs with Objects & Classes
A friend function of a class is granted:
ANo special access at all
BAccess to the class's private and protected members
CAutomatic membership in the class
DOnly access to public members, same as any other function
Answer is hidden
Question 31 of 72Features of Object-Oriented Programming
Operator overloading in C++ allows an operator such as '+' to:
AWork only with built-in types
BBe redefined to work with objects of a user-defined class
CBe removed from the language
DOnly be used in unary form
Answer is hidden
Question 32 of 72Features of Object-Oriented Programming
A unary operator overload acts on:
ATwo operands
BA single operand
CThree operands
DNo operands at all
Answer is hidden
Question 33 of 72Features of Object-Oriented Programming
Converting a built-in type into a class-type object can be achieved using:
AA destructor
BA converting (single-argument) constructor
CA friend function only
DThe 'this' pointer
Answer is hidden
Question 34 of 72Features of Object-Oriented Programming
In multiple inheritance, a derived class inherits from:
AExactly one base class
BMore than one base class directly
CNo base class at all
DOnly classes in the same file
Answer is hidden
Question 35 of 72Features of Object-Oriented Programming
Multilevel inheritance is best described as:
AMany classes inheriting from one base
BA chain, where a class derives from a base, and another class derives from that derived class
COne class inheriting from two unrelated bases
DNo inheritance at all
Answer is hidden
Question 36 of 72Features of Object-Oriented Programming
Hierarchical inheritance involves:
AOne derived class from one base class
BMultiple derived classes inheriting from a single common base class
CA chain of single inheritances only
DNo base class
Answer is hidden
Question 37 of 72Features of Object-Oriented Programming
The 'diamond problem' in C++ inheritance arises specifically in:
ASingle inheritance
BMultipath inheritance, where two base classes share a common ancestor
CFunction overloading
DOperator overloading
Answer is hidden
Question 38 of 72Features of Object-Oriented Programming
The diamond problem in multipath inheritance is typically resolved using:
AFriend functions
BVirtual base classes
CStatic data members
DOperator overloading
Answer is hidden
Question 39 of 72Features of Object-Oriented Programming
In single inheritance, when a derived class object is created, which constructor executes first?
AThe derived class constructor
BThe base class constructor
CNeither executes
DBoth execute simultaneously
Answer is hidden
Question 40 of 72Features of Object-Oriented Programming
Destructors in an inheritance hierarchy execute in which order relative to constructors?
AThe same order as constructors
BThe exact reverse order of constructors
CA random order
DDestructors never execute automatically
Answer is hidden
Question 41 of 72Pure Virtual Function & File Handling
A virtual function allows:
AOnly the base class version to ever be called
BA derived class to override it so the correct version is called based on actual object type
CFunctions to be overloaded only
DStatic binding exclusively
Answer is hidden
Question 42 of 72Pure Virtual Function & File Handling
A pure virtual function is declared in the base class with:
ANo special syntax, just 'virtual'
B'= 0' after the function declaration
CThe 'static' keyword
DThe 'friend' keyword
Answer is hidden
Question 43 of 72Pure Virtual Function & File Handling
A class containing at least one pure virtual function is called:
AA concrete class
BAn abstract class, which cannot be instantiated directly
CA static class
DA friend class
Answer is hidden
Question 44 of 72Pure Virtual Function & File Handling
Dynamic (late) binding means the function implementation to call is decided:
AAt compile time, based on pointer/reference type
BAt runtime, based on the actual object type
CNever, since only one version exists
DRandomly at each call
Answer is hidden
Question 45 of 72Pure Virtual Function & File Handling
Which C++ stream class is used specifically for output file operations?
Aifstream
Bofstream
Ccin
Dcerr only
Answer is hidden
Question 46 of 72Pure Virtual Function & File Handling
The root class of the C++ I/O stream class hierarchy is:
Answer is hidden
Question 47 of 72Pure Virtual Function & File Handling
The stream state function eof() is used to check whether:
AAn I/O error has occurred
BThe end of the file/stream has been reached
CThe stream is still good
DA pure virtual function was called
Answer is hidden
Question 48 of 72Pure Virtual Function & File Handling
The manipulator setw() is used to:
ASet the output field width
BOpen a file
CDeclare a virtual function
DOverload an operator
Answer is hidden
Question 49 of 72Pure Virtual Function & File Handling
The endl manipulator, when used with cout, inserts:
AA tab character only
BA newline and flushes the output buffer
CA pure virtual function call
DA file close operation
Answer is hidden
Question 50 of 72Pure Virtual Function & File Handling
Unformatted I/O functions such as get() and put() operate at the level of:
AWhole files only
BIndividual (raw) characters
CEntire classes
DVirtual function tables
Answer is hidden
Question 51 of 72Generic Programming & Exception Handling
A function template in C++ allows a single function definition to:
AWork with only one specific data type
BWork generically with multiple data types, with the compiler generating specific versions
CReplace all classes in a program
DAvoid using parameters entirely
Answer is hidden
Question 52 of 72Generic Programming & Exception Handling
A class template enables the creation of:
AOnly non-generic, fixed-type classes
BGeneric data structures that work with any data type (e.g. a generic Stack)
COnly exception handling code
DOnly virtual functions
Answer is hidden
Question 53 of 72Generic Programming & Exception Handling
In the STL, which component connects generic algorithms to containers?
AContainers alone
BIterators
CExceptions
DNamespaces
Answer is hidden
Question 54 of 72Generic Programming & Exception Handling
Which STL component provides generic functions such as sort and find?
AContainers
BAlgorithms
CTemplates only
DStreams
Answer is hidden
Question 55 of 72Generic Programming & Exception Handling
In C++ exception handling, code that might raise an exception is placed inside a:
Acatch block
Btry block
Cthrow block only
Dtemplate block
Answer is hidden
Question 56 of 72Generic Programming & Exception Handling
A single try block in C++ can be followed by:
AAt most one catch block
BMultiple catch blocks, each handling a different exception type
CNo catch blocks at all
DOnly a throw statement
Answer is hidden
Question 57 of 72Generic Programming & Exception Handling
The syntax catch(...) is used to:
ACatch only integer exceptions
BCatch any type of exception, as a fallback handler
CDeclare a function template
DRethrow an exception automatically
Answer is hidden
Question 58 of 72Generic Programming & Exception Handling
Rethrowing a caught exception is done using:
Athrow; (with no operand) inside the catch block
BA new try block only
CThe 'template' keyword
Dcatch(...) exclusively
Answer is hidden
Question 59 of 72Generic Programming & Exception Handling
If a thrown exception has no matching catch handler anywhere in the program, what happens?
AThe program continues normally, ignoring the exception
Bterminate() is called, typically aborting the program
CThe exception is automatically caught by main()
DA new exception type is created automatically
Answer is hidden
Question 60 of 72Generic Programming & Exception Handling
An exception object can carry additional data (such as an error code) by:
ABeing thrown with arguments that the catch block's parameter receives
BNever being allowed to carry any data
CRequiring a separate global variable only
DUsing only the 'this' pointer
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