Introduction to Computing MCQs with Answers
Practice important Introduction to Computing MCQs with answers and explanations.
Chapter: 120
Q1761:
Which line in the example code executes when CGPA is less than 3.0?
A. cout << "Give Scholarship";
B. cout << "Sorry you do not qualify for the scholarship";
C. float f = 3.5;
D. The entire if-else block
Correct Answer:
B
Chapter: 120
Q1762:
What will be the output of the code if CGPA is exactly 3.0?
A. "Give Scholarship"
B. "Sorry you do not qualify for the scholarship"
C. "Scholarship granted"
D. "No output"
Correct Answer:
A
Chapter: 120
Q1763:
Fill in the blank: The if-else statement in the code is used to ______ based on the CGPA value.
A. Print different messages
B. Declare different variables
C. Change the value of CGPA
D. Execute a loop
Correct Answer:
A
Chapter: 120
Q1764:
What is the role of the else block in the example?
A. To print "Give Scholarship"
B. To handle cases where the if condition is false
C. To initialize the CGPA variable
D. To execute a loop
Correct Answer:
B
Chapter: 120
Q1765:
In the example code, what would happen if cout was replaced with printf?
A. The output would be formatted differently
B. The code would result in an error
C. The output would remain the same
D. printf would not be recognized
Correct Answer:
A
Chapter: 121
Q1766:
What does the while loop in the example code do?
A. It prints numbers from 1 to 5
B. It increments the value of i only once
C. It initializes the value of i to 5
D. It exits immediately after the first iteration
Correct Answer:
A
Chapter: 121
Q1767:
How many times will the while loop execute in the given code?
A. 4
B. 5
C. 6
D. 7
Correct Answer:
B
Chapter: 121
Q1768:
Fill in the blank: In the while loop example, the loop terminates when the value of i ______.
A. Is greater than 5
B. Is less than 5
C. Equals 5
D. Is equal to 6
Correct Answer:
A
Chapter: 121
Q1769:
Which line of code increments the value of i in the while loop example?
A. i = i + 1;
B. cout << i;
C. while(i <= 5)
D. int i = 1;
Correct Answer:
A
Chapter: 121
Q1770:
What will be printed by the code in the while loop when i reaches 6?
A. "1 2 3 4 5"
B. "1 2 3 4 5 6"
C. "1 2 3 4 5 6 "
D. "6"
Correct Answer:
A
Chapter: 121
Q1771:
Fill in the blank: The condition i <= 5 in the while loop checks whether i ______.
A. Is less than or equal to 5
B. Is greater than 5
C. Is equal to 5
D. Is less than 6
Correct Answer:
A
Chapter: 121
Q1772:
What will be the value of i when the loop terminates?
A. 5
B. 6
C. 7
Correct Answer:
B
Chapter: 121
Q1773:
How many print statements are executed in the while loop?
A. 4
B. 5
C. 6
D. 7
Correct Answer:
B
Chapter: 121
Q1774:
What is the purpose of the while loop in the given example?
A. To print numbers from 1 to 5
B. To initialize i
C. To reset i
D. To perform arithmetic operations
Correct Answer:
A
Chapter: 121
Q1775:
Fill in the blank: The statement cout << i; inside the while loop ______.
A. Displays the value of i to the screen
B. Increments the value of i
C. Checks if i is less than 5
D. Initializes i
Correct Answer:
A
Chapter: 121
Q1776:
What happens when i becomes 6 in the while loop?
A. The loop continues to execute
B. The loop terminates
C. The loop restarts
D. The value of i is reset to 1
Correct Answer:
B
Chapter: 122
Q1777:
What is the approach of creating multiple activations of a single program to achieve the illusion of multiple spaceships called?
A. Sequential processing
B. Parallel processing
C. Single-threaded processing
D. Multi-core processing
Correct Answer:
B
Chapter: 122
Q1778:
In which programming language is simultaneous actions performed by creating multiple tasks?
A. Java
B. Ada
C. C++
D. Python
Correct Answer:
B
Chapter: 122
Q1779:
What does parallel processing require for true parallelism?
A. A single CPU
B. Multiple CPU cores
C. A multi-core processor
D. A single thread
Correct Answer:
B
Chapter: 122
Q1780:
What is the term used in Java for simultaneous actions similar to tasks in Ada?
A. Thread
B. Task
C. Process
D. Function
Correct Answer:
A