First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Computer Fundamentals and Number Systems
Which number system is used internally by digital computers because its two symbols map directly onto the two stable states of a switching circuit?
- Decimal
- Hexadecimal
- Octal
- Binary Correct answer.
Explanation
A digital circuit has two reliable states, on and off, so two symbols (0 and 1) suffice to represent them. Binary uses exactly these two symbols, making it the natural internal representation. Decimal, octal and hexadecimal each need more than two distinct voltage levels per digit position.
Question 2Computer Fundamentals and Number Systems
In the decimal number 5072, what value does the digit 5 contribute?
- 5
- 50
- 5000 Correct answer.
- 500
Explanation
Decimal is positional with base 10, so each place value is a power of ten. The digit 5 sits in the thousands place, meaning 5 x 10^3 = 5000. Its contribution is therefore five thousand, not five hundred or fifty.
Question 3Computer Fundamentals and Number Systems
What is the decimal value of the binary number 1101?
- 13 Correct answer.
- 11
- 12
- 15
Explanation
Binary place values from the right are 1, 2, 4 and 8. Adding the weights where a 1 appears gives 8 + 4 + 1 = 13. The zero in the twos column contributes nothing.
Question 4Computer Fundamentals and Number Systems
How many distinct digits does the hexadecimal number system provide?
- 16 Correct answer.
- 2
- 10
- 8
Explanation
Hexadecimal is base 16, so it needs sixteen distinct symbols. These are 0-9 followed by A-F, where A stands for ten through F for fifteen. Each hexadecimal digit maps to exactly four binary bits.
Question 5Computer Fundamentals and Number Systems
Which unit is the smallest and represents one binary digit?
- Nibble
- Byte
- Bit Correct answer.
- Word
Explanation
A bit is a single binary digit, either 0 or 1, and is the smallest unit of data. A nibble is four bits and a byte is eight bits, so both are larger groupings. A word is a machine-dependent group of bits used by the processor.
Question 6Computer Fundamentals and Number Systems
Which of the following is an input device in a computer system?
- Speaker
- Scanner Correct answer.
- Monitor
- Plotter
Explanation
Input devices bring data from the outside world into the computer. A scanner converts a printed page into digital data, so it is an input device. Plotters, speakers and monitors all present processed results to the user and are output devices.
Question 7Computer Fundamentals and Number Systems
Which memory is volatile, meaning its contents are lost when power is switched off?
- ROM
- Hard disk
- RAM Correct answer.
- Flash drive
Explanation
Volatile memory loses its stored data when the power supply is removed. RAM is the working memory of a running program and is volatile. ROM, hard disks and flash drives all retain their contents without power.
Question 8Computer Fundamentals and Number Systems
What is the octal equivalent of the binary number 101101?
- 65
- 54
- 45
- 55 Correct answer.
Explanation
Group binary digits in threes from the right: 101 and 101. Each group converts to 5, since 4 + 1 = 5. Joining them gives octal 55.
Question 9Computer Fundamentals and Number Systems
What is the decimal value of the hexadecimal number 2F?
- 215
- 31
- 45
- 47 Correct answer.
Explanation
In hexadecimal, F equals fifteen. The value is 2 x 16 + 15 = 32 + 15 = 47. Treating F as a letter rather than fifteen is the usual source of error.
Question 10Computer Fundamentals and Number Systems
Using 8-bit two's complement representation, how is the decimal number -5 stored?
- 11111011 Correct answer.
- 00000101
- 11111010
- 10000101
Explanation
Write +5 as 00000101, invert the bits to get 11111010, then add 1 to obtain 11111011. The leading 1 signals a negative value. The magnitude bits 1111011 correspond to 5 after the same process.
Question 11Computer Fundamentals and Number Systems
What is the result of adding the binary numbers 1011 and 0110?
- 10001 Correct answer.
- 10011
- 11001
- 10101
Explanation
Add column by column from the right: 1+0=1, 1+1=0 carry 1, 0+1+1=0 carry 1, 1+0+1=0 carry 1, giving a final carry of 1. The sum is 10001, which equals 17 in decimal, matching 11 + 6.
Question 12Computer Fundamentals and Number Systems
Which logic gate produces a HIGH output only when all of its inputs are HIGH?
- AND Correct answer.
- NOR
- OR
- NOT
Explanation
The AND gate outputs 1 only when every input is 1; a single 0 input forces the output to 0. The OR gate needs just one HIGH input, and the NOT gate inverts a single input. The NOR gate is an inverted OR, so it outputs 1 when all inputs are 0.
Question 13Computer Fundamentals and Number Systems
Which of these is an example of system software rather than application software?
- Spreadsheet program
- Operating system Correct answer.
- Photo editor
- Web browser
Explanation
System software manages hardware and provides a platform for other programs, and the operating system is its core example. Spreadsheets, photo editors and browsers are application software written to perform user tasks.
Question 14Computer Fundamentals and Number Systems
What does the acronym CPU stand for, and what is its main function?
- Control Program Utility; it manages printing jobs
- Central Processing Unit; it executes instructions and controls the system Correct answer.
- Central Peripheral Unit; it converts analog signals
- Computer Personal Unit; it stores files permanently
Explanation
The CPU is the Central Processing Unit, containing the control unit, arithmetic logic unit and registers. It fetches, decodes and executes instructions and coordinates the other components. It does not provide permanent storage or manage printing.
Question 15Computer Fundamentals and Number Systems
What is the decimal equivalent of the binary fraction 0.101?
- 0.5
- 0.75
- 0.125
- 0.625 Correct answer.
Explanation
Fractional binary place values are 1/2, 1/4 and 1/8. The bits 1, 0, 1 give 0.5 + 0 + 0.125 = 0.625. The middle zero contributes nothing.
Question 16Computer Fundamentals and Number Systems
Express the decimal number 45 in binary.
- 110101
- 101101 Correct answer.
- 101011
- 100101
Explanation
Repeated division by 2 gives remainders 1, 0, 1, 1, 0, 1 read upward. Place values 32 + 8 + 4 + 1 = 45, confirming 101101. Checking the weights is a quick way to verify the conversion.
Question 17Computer Fundamentals and Number Systems
Which statement correctly distinguishes primary memory from secondary storage?
- Primary memory is directly accessed by the CPU, while secondary storage is not Correct answer.
- Secondary storage holds only the operating system, while primary memory holds user files
- Primary memory is non-volatile, while secondary storage is always volatile
- Primary memory is slower than secondary storage but larger in capacity
Explanation
Primary memory such as RAM is directly addressable by the CPU and holds currently executing programs. Secondary storage such as disks must be accessed through input and output operations and is used for long-term retention. Typically primary memory is faster but smaller and volatile.
Question 18Computer Fundamentals and Number Systems
What is the hexadecimal representation of the binary number 11101010?
- FA
- AE
- DA
- EA Correct answer.
Explanation
Split into nibbles: 1110 and 1010. The first nibble is 8 + 4 + 2 = 14, which is E, and the second is 8 + 2 = 10, which is A. The result is EA.
Question 19Computer Fundamentals and Number Systems
Which type of software translation converts an entire high-level program into machine code before execution, producing an object file?
- Interpreter
- Assembler
- Linker
- Compiler Correct answer.
Explanation
A compiler translates the whole source program into machine code in one pass before the program runs. An interpreter translates and executes statement by statement at run time. An assembler handles assembly language, and a linker joins object modules rather than translating source.
Question 20Computer Fundamentals and Number Systems
In 8-bit two's complement, what is the decimal value of the bit pattern 10000000?
- 128
- -128 Correct answer.
- -0
- -127
Explanation
In 8-bit two's complement the leading bit carries weight -128 and the remaining bits add 0. The value is therefore -128, which is the most negative number representable. There is no negative zero in two's complement, and +128 cannot be represented in 8 bits.
Question 21Computer Fundamentals and Number Systems
How many bits are required to represent the unsigned decimal range 0 to 200?
- 10
- 7
- 8 Correct answer.
- 9
Explanation
With n bits you can represent 2^n distinct values, from 0 to 2^n - 1. Seven bits cover only 0 to 127, which is insufficient. Eight bits cover 0 to 255, which includes 200, so eight bits are enough and are the minimum.
Question 22Computer Fundamentals and Number Systems
A computer uses 12-bit two's complement integers. What is the largest positive value it can store?
- 4095
- 2047 Correct answer.
- 2048
- 4096
Explanation
For n-bit two's complement the range is -2^(n-1) to 2^(n-1) - 1. With n = 12 this gives -2048 to 2047, so the largest positive value is 2047. One bit is reserved for the sign, halving the positive range compared with unsigned.
Question 23Computer Fundamentals and Number Systems
What is the result of subtracting 0110 from 1011 using binary subtraction?
- 0011
- 1001
- 0110
- 0101 Correct answer.
Explanation
Subtract from the right: 1-0=1; for the next column 1-1=0; then 0-1 requires borrowing, so 10-1=1 with a borrow; finally 1-0-1 (borrow) = 0. The result is 0101, which equals 11 - 6 = 5.
Question 24Computer Fundamentals and Number Systems
Which statement about the relationship between the number of bits and the number of distinct patterns is correct?
- Each added bit increases the number of patterns by two
- The number of patterns equals the number of bits squared
- Each added bit doubles the number of distinct patterns Correct answer.
- The number of patterns grows linearly with the number of bits
Explanation
With n bits there are 2^n distinct patterns, so going from n to n+1 bits multiplies the count by two. This exponential growth explains why a few extra bits greatly extend the representable range. Linear or additive growth would badly understate the capacity.
Question 25Programming Fundamentals and Problem Solving
In pseudocode, which control structure is most suitable when the number of repetitions is known before the loop starts?
- A counted FOR loop Correct answer.
- A WHILE loop with a sentinel value
- A nested IF statement
- A REPEAT-UNTIL loop
Explanation
A counted FOR loop is designed for situations where the iteration count is determined in advance, because the start value, end value and step are all specified in the loop header. It removes the need to manage the counter manually. Sentinel-controlled loops and conditional structures are used when repetition depends on a condition evaluated at run time.
Question 26Programming Fundamentals and Problem Solving
A variable declared inside a procedure is described as having which scope?
- File scope
- Static scope
- Global scope
- Local scope Correct answer.
Explanation
A variable declared inside a procedure exists only while that procedure executes, so it has local scope and cannot be referenced by name from outside the procedure. This limits accidental interference between different parts of a program. Global scope applies to declarations visible throughout the program.
Question 27Programming Fundamentals and Problem Solving
Which data type is the most appropriate choice for storing whether a student has paid their examination fee?
- String
- Integer
- Real
- Boolean Correct answer.
Explanation
A Boolean stores one of two logical states, such as paid or unpaid, which matches the yes/no nature of the fact being recorded. Using a Boolean makes the intent clear and prevents invalid values. Integer, string and real types would allow many irrelevant values.
Question 28Programming Fundamentals and Problem Solving
What value does the expression 17 MOD 5 produce?
- 3
- 2 Correct answer.
- 3.4
- 12
Explanation
The MOD operator returns the remainder after integer division. Since 17 divided by 5 is 3 with remainder 2, the result is 2. Integer division itself would give 3, and ordinary division would give 3.4.
Question 29Programming Fundamentals and Problem Solving
Which of the following is a valid identifier for a variable in most programming languages?
- total marks
- total_marks Correct answer.
- 2ndMark
- total-marks
Explanation
An identifier normally must begin with a letter and may contain letters, digits and underscores, so total_marks is valid. Spaces and hyphens are not permitted because they are treated as separators or operators. A leading digit is also disallowed.
Question 30Programming Fundamentals and Problem Solving
In a flowchart, which symbol represents a decision?
- An oval
- A diamond Correct answer.
- A parallelogram
- A rectangle
Explanation
A diamond is the standard flowchart symbol for a decision, with one entry path and multiple labelled exit paths for the possible outcomes. Rectangles denote processes and parallelograms denote input or output. Ovals mark the start and end of the algorithm.
Question 31Programming Fundamentals and Problem Solving
Which of the following best describes an algorithm?
- A finite sequence of unambiguous steps that solves a problem Correct answer.
- A programming language used to write software
- A diagram showing the physical layout of a computer
- A collection of data stored on a disk
Explanation
An algorithm is a finite, ordered and unambiguous set of steps that transforms inputs into a required output. It is independent of any particular programming language or machine. Programs are implementations of algorithms rather than algorithms themselves.
Question 32Programming Fundamentals and Problem Solving
A student writes the assignment statement total = total + 1 inside a loop. What is the purpose of this statement?
- To reset total to zero each time
- To declare total as a constant
- To increase the value of total by one Correct answer.
- To test whether total equals one
Explanation
The statement reads the current value of total, adds one and stores the result back in total, so it acts as a counter increment. This pattern is common in loops that must track how many times the body has run. It does not test, reset or declare anything.
Question 33Programming Fundamentals and Problem Solving
Consider the sequence of values 4, 9, 2, 7, 5. After one complete pass of a bubble sort that moves the largest value to the end, what is the order of the list?
- 2, 4, 5, 7, 9
- 4, 9, 2, 7, 5
- 4, 2, 7, 5, 9 Correct answer.
- 9, 7, 5, 4, 2
Explanation
A bubble sort pass compares adjacent pairs and swaps them when out of order, so the largest value migrates to the final position. Comparing 4 and 9, then 9 and 2 (swap), 9 and 7 (swap), 9 and 5 (swap) gives 4, 2, 7, 5, 9. Only the largest element is guaranteed to be placed after one pass.
Question 34Programming Fundamentals and Problem Solving
A linear search is performed on a list of 500 items and the target is the last element. How many comparisons are needed in the worst case?
- 500 Correct answer.
- 9
- 250
- 1
Explanation
A linear search examines elements one at a time from the start, so reaching the final element requires comparing every element once, giving 500 comparisons. Its worst case is therefore proportional to the list size. Binary search would need far fewer comparisons but requires sorted data.
Question 35Programming Fundamentals and Problem Solving
What is the output of the following pseudocode?
SET x = 10
SET y = 3
SET result = x / y
DISPLAY result rounded to 2 decimal places
- 3.00
- 3
- 4
- 3.33 Correct answer.
Explanation
Dividing 10 by 3 gives 3.333..., which rounds to 3.33 when displayed to two decimal places. The division here is real division, so the fractional part is retained. Rounding to two places keeps two digits after the decimal point.
Question 36Programming Fundamentals and Problem Solving
A procedure is written to calculate the average of a list of numbers. Which parameter passing method allows the procedure to return the computed average to the calling program through a parameter?
- Pass by reference Correct answer.
- Pass by value
- Pass by constant
- Pass by literal
Explanation
Passing a parameter by reference gives the procedure direct access to the caller's variable, so any assignment inside the procedure changes the original value and can carry a result back out. Pass by value copies the argument, leaving the caller's variable unchanged. This distinction is central to designing procedures that return results.
Question 37Programming Fundamentals and Problem Solving
Which statement about the relationship between a compiler and an interpreter is correct?
- An interpreter produces a standalone executable file, while a compiler does not
- A compiler translates the whole program before execution, while an interpreter translates and runs it line by line Correct answer.
- A compiler runs the source code directly, while an interpreter produces machine code
- Both always translate the entire program before any execution begins
Explanation
A compiler translates the complete source program into machine code or intermediate code before it is run, whereas an interpreter translates and executes statements one at a time. This means compiled programs generally run faster but need recompilation after edits. Interpreted programs are easier to debug interactively.
Question 38Programming Fundamentals and Problem Solving
What does the expression NOT (A AND B) evaluate to when A is TRUE and B is FALSE?
- FALSE
- TRUE Correct answer.
- Undefined
- Both TRUE and FALSE
Explanation
A AND B is FALSE because one operand is FALSE. Applying NOT to FALSE yields TRUE. Boolean operators follow fixed truth tables, so the result is determined entirely by the operand values.
Question 39Programming Fundamentals and Problem Solving
A program must repeatedly read marks from the user until a negative value is entered. Which loop design is most appropriate?
- A loop that runs exactly ten times
- A WHILE loop that continues while the value read is not negative Correct answer.
- A single IF statement
- A FOR loop counting from 1 to 100
Explanation
The number of inputs is unknown in advance and termination depends on the data, so a condition-controlled WHILE loop testing the entered value is appropriate. This is a sentinel-controlled loop, where the negative value signals the end. A counted loop would impose an arbitrary limit.
Question 40Programming Fundamentals and Problem Solving
The values 8, 3, 5, 1 are pushed onto a stack in that order. Two pop operations are then performed. What is the value at the top of the stack afterwards?
- 1
- 5 Correct answer.
- 8
- 3
Explanation
A stack follows last-in-first-out order, so the first pop removes 1 and the second removes 5. The remaining stack has 3 on top of 8. The next pop would therefore return 5.
Question 41Programming Fundamentals and Problem Solving
A queue processes elements in which order?
- Highest value first
- First in, first out Correct answer.
- Last in, first out
- Random order
Explanation
A queue is a first-in-first-out structure: elements are removed in the same order they were added, as with a line of people. New items join at the rear and leave from the front. A stack, by contrast, is last-in-first-out.
Question 42Programming Fundamentals and Problem Solving
Which of the following is an example of a syntax error rather than a logic error?
- Using an assignment where a comparison was intended
- Dividing by a value that becomes zero at run time
- Using the wrong formula to compute interest
- Missing a closing bracket in an expression Correct answer.
Explanation
A syntax error breaks the grammatical rules of the language, such as an unbalanced bracket, and is detected before the program can run. Logic errors produce valid code that gives the wrong result. Run-time errors occur while the program executes.
Question 43Programming Fundamentals and Problem Solving
A recursive procedure computes the factorial of n. Which condition must every correct recursive procedure include?
- A base case that stops further calls Correct answer.
- A global variable holding the result
- A parameter passed by reference
- A loop that counts down from n
Explanation
Every recursion needs at least one base case that can be solved without another recursive call, otherwise the calls never terminate and the stack overflows. The recursive case must move the argument towards that base case. Loops, globals and reference parameters are not required.
Question 44Programming Fundamentals and Problem Solving
A 2D array marks[3][4] stores student scores. What does the second index represent in this declaration?
- The highest score recorded
- The total number of scores stored
- The number of students
- The number of scores per student Correct answer.
Explanation
In marks[3][4] the first index gives the number of rows, usually students, and the second gives the number of columns, usually the scores recorded for each student. The array therefore holds 3 x 4 = 12 elements. The second index does not represent a total or a maximum.
Question 45Programming Fundamentals and Problem Solving
A programmer writes a loop that never modifies the variable tested in its condition, and the condition is initially true. What is the most likely consequence?
- The loop terminates after one iteration
- The compiler automatically inserts a counter
- The loop runs forever, producing an infinite loop Correct answer.
- The loop body is skipped entirely
Explanation
If the controlling condition never changes, it remains true and the loop never exits, creating an infinite loop. Termination requires that something inside the loop eventually makes the condition false. Compilers do not automatically repair such logic.
Question 46Programming Fundamentals and Problem Solving
A binary search is applied to the list 2, 5, 8, 12, 16, 23, 38, 56, 72, 91 to find the value 23. Which element is compared first?
- 23
- 16 Correct answer.
- 12
- 38
Explanation
Binary search examines the middle element of the current range. With ten elements the middle lies between positions 5 and 6, and the lower middle is 16. Since 23 is greater than 16, the search then continues in the upper half.
Question 47Programming Fundamentals and Problem Solving
An algorithm has two consecutive loops over the same list of n items, the first performing n operations and the second also performing n operations. What is the overall time complexity?
- O(1)
- O(log n)
- O(n squared)
- O(n) Correct answer.
Explanation
Consecutive loops add their costs, so n + n = 2n, and constant factors are dropped in big-O notation, leaving O(n). Complexity becomes O(n squared) only when one loop is nested inside another. Sequential loops do not multiply.
Question 48Programming Fundamentals and Problem Solving
A procedure is intended to swap two variables a and b. It is called as swap(a, b) and both parameters are passed by value. What happens after the call?
- The values of a and b remain unchanged in the calling program Correct answer.
- The values of a and b are exchanged in the calling program
- Only a is changed, while b remains the same
- The program fails with a compile error
Explanation
Pass by value copies the arguments into the procedure's own parameters, so any swapping happens only to the copies. When the procedure returns, the originals in the caller are untouched. To swap the caller's variables, the parameters must be passed by reference.
Question 49Programming Fundamentals and Problem Solving
A list of 1,000 sorted items is searched with binary search. Approximately how many comparisons are needed in the worst case?
- 10 Correct answer.
- 500
- 100
- 1,000
Explanation
Binary search halves the search range each time, so the worst case is about log base 2 of n. Since 2 to the power 10 is 1,024, roughly ten comparisons suffice for 1,000 items. This is far fewer than the linear search worst case.
Question 50Programming Fundamentals and Problem Solving
In pseudocode, which control structure is designed to execute a block of statements a known number of times, controlled by a counter that is initialised, tested, and updated?
- A counted FOR loop Correct answer.
- A WHILE loop
- An IF selection
- A CASE selection
Explanation
A counted FOR loop bundles the three steps of counter control into one statement: it initialises the counter, tests it against a limit, and increments it on each iteration. This makes it the natural choice when the number of repetitions is known in advance. WHILE and IF/CASE structures do not themselves provide counter management.