Computer — All MCQs
4795 questions available
Q2321.What will happen in the following C++ code? extern void display(); int main() { display(); }
Correct Answer: C
The extern keyword declares a function without providing its definition. display() is called in main, but the compiler cannot find its actual implementation. Compilation passes the syntax check, but linking fails. The linker reports an undefined reference error.
Q2322.What is the issue in the following C++ function? void show(int x = 5, int y = 10)
Correct Answer: B
In C++, default arguments must be assigned from right to left. If a parameter has a default value, all parameters to its right must also have defaults. The rule ensures unambiguous function calls.
Q2323.Determine the output of the following? JavaScript code: console.log(false == 0) console.log(false === 0)
Correct Answer: C
console.log(false == 0) prints true because '==' performs type coercion, and false coerces to 0, so 0 == 0 is true. console.log(false === 0) prints false because '===' checks both value and type, and a boolean is never strictly equal to a number.
Q2324.A variable starts at 0 and is incremented by +2 each time. It should not exceed 10. How many iterations are required?
Correct Answer: B
Start value = 0. Increment by +2 each time. Iterations: 1 -> 2; 2 -> 4; 3 -> 6; 4 -> 8; 5 -> 10. After 5 iterations, value reaches 10 (limit). It should not exceed 10, so we stop here. Total iterations = 5.
Q2325.Which loop is used to retrieve the first true condition and then stops?
Correct Answer: D
An if statement checks a condition and executes once if it is true. It does not loop repeatedly, unlike for, while, or do-while loops. It effectively stops after the first true condition is evaluated.
Q2326.Determine the output of the program: int x = 0; while (x < 5) { x += 2; } cout << x;
Correct Answer: C
Initial value: x = 0. Loop runs while x < 5. Iterations: 1st: x = 0 + 2 = 2. 2nd: x = 2 + 2 = 4. 3rd: x = 4 + 2 = 6. Now x = 6, condition x < 5 becomes false, loop stops. Final value printed is 6.
Q2327.If systems are overloaded with data, what is the safest action to prevent a crash?
Correct Answer: D
Load balancing distributes incoming data across multiple systems to reduce overload. Throttling limits the rate of incoming requests to keep the system stable. These methods help prevent crashes while keeping services running.
Q2328.Which protocol is connectionless?
Correct Answer: B
UDP (User Datagram Protocol) is a connectionless protocol. It sends data without establishing a connection between sender and receiver. UDP is faster but less reliable than TCP. TCP is connection-oriented and ensures data delivery.
Q2329.Given syntax is correct but output/error shows "video can't be played". Likely cause?
Correct Answer: A
The syntax is already correct, so the issue is not in the code. Browsers support only certain formats like MP4, WebM, or OGG.
Q2330.In a monolithic network architecture, what is true?
Correct Answer: A
A monolithic network architecture typically connects all devices to a single, central switch or hub, centralizing traffic and management but introducing a single point of failure.
Q2331.Snippet: System.out.println("Hello World")?
Correct Answer: C
System.out.println() is a Java statement used to print output to the console. C++ uses cout << "Hello World";. Python uses print("Hello World"). JavaScript uses console.log("Hello World");. This syntax is specific to Java's standard output system.
Q2332.Which security system only detects threats but does not take any action?
Correct Answer: A
An IDS monitors network or system activities to detect potential threats. It does not block or prevent attacks; it only alerts administrators. An IPS (Intrusion Prevention System) can take action to stop threats. Antivirus and firewalls actively block or remove malicious activity.
Q2333.Which program/code corresponds to Pandas library in Python?
Correct Answer: A
Pandas is a Python library for data manipulation and analysis. The standard import statement is: import pandas as pd. NumPy is for numerical computations, Matplotlib is for data visualization, and Scikit-learn is for machine learning.
Q2334.What does data redundancy refer to?
Correct Answer: A
Data redundancy occurs when the same piece of data is stored in more than one location. It often happens in databases or storage systems. Redundant data can waste storage space and increase the risk of inconsistencies.
Q2335.BIOS is used for?
Correct Answer: B
BIOS (Basic Input/Output System) is firmware that starts up the computer. It initializes hardware like CPU, memory, and storage when the computer is powered on. BIOS loads the operating system from the hard drive into memory. It also provides basic communication between the OS and hardware devices.
Q2336.Which symbols in a Use Case Diagram represent the start and end of a process?
Correct Answer: D
In Use Case Diagrams or Activity Diagrams, the start of a process is shown with a filled circle. The end of a process is represented by a filled circle inside another circle (final node). Ovals represent use cases, and rectangles are typically used for system boundaries.
Q2337.In set theory, what does the * symbol represent in the context of Cartesian products?
Correct Answer: D
In set theory, the Cartesian product of two sets A and B is written as A x B (sometimes represented with * in programming contexts). It produces a set of all ordered pairs (a, b) where a belongs to A and b belongs to B.
Q2338.In a Use Case Diagram, what is the purpose of the oval symbol?
Correct Answer: C
In a Use Case Diagram, an oval denotes a use case, which is a specific functionality of the system. Actors (users or external systems) are represented by stick figures.
Q2339.In NLP, the sentence "He has duck" can create ambiguity. What is the issue here?
Correct Answer: B
Lexical ambiguity occurs when a word has multiple meanings. In "He has duck," "duck" could be a noun (the bird) or a verb (to lower the head quickly). The sentence is grammatically correct but unclear in meaning.
Q2340.What is the main difference between malware and ransomware?
Correct Answer: B
Malware is any software designed to harm or exploit a computer system. Ransomware is a type of malware that encrypts files and demands payment to unlock them. Not all malware is ransomware.