Skip to main content

Introduction to Computing MCQs with Answers

Practice important Introduction to Computing MCQs with answers and explanations.

Chapter: 118
Q1741:
Which programming languages use the := symbol for assignment?
A. Python and Java
B. Ada and Pascal
C. C and C++
D. JavaScript and Ruby
Correct Answer: B
Chapter: 118
Q1742:
Fill in the blank: In the statement Z = X + Y;, what does = represent?
A. Addition operator
B. Assignment operator
C. Comparison operator
D. Logical operator
Correct Answer: B
Chapter: 118
Q1743:
How does the syntax of assignment statements differ between Python and Ada?
A. Python uses = while Ada uses :=
B. Python uses := while Ada uses =
C. Both use =
D. Both use :=
Correct Answer: A
Chapter: 118
Q1744:
What does the statement Z = X + Y; accomplish in C, C++, and Java?
A. It assigns the value of X to Y
B. It calculates X + Y and stores the result in Z
C. It prints the result of X + Y
D. It compares X and Y
Correct Answer: B
Chapter: 118
Q1745:
Which of the following is NOT a correct assignment statement in C?
A. X = 10;
B. X := 10;
C. X = Y + 5;
D. X = (Y - 3);
Correct Answer: B
Chapter: 119
Q1746:
What does a control statement do in programming?
A. Alters the execution sequence
B. Declares variables
C. Defines functions
D. Imports libraries
Correct Answer: A
Chapter: 119
Q1747:
What is the basic syntax of an if-else statement?
A. if (condition) StatementA else StatementB
B. if condition then StatementA else StatementB
C. if (condition) { StatementA } else { StatementB }
D. if (condition) StatementA else StatementB
Correct Answer: C
Chapter: 119
Q1748:
Fill in the blank: In the if (marks>=50) { You have passed; } else { You have failed; } statement, what does marks>=50 represent?
A. A control statement
B. A comparison condition
C. An arithmetic operation
D. A logical operator
Correct Answer: B
Chapter: 119
Q1749:
How does the if-else statement handle execution based on conditions?
A. Executes both blocks
B. Executes the block where the condition is false
C. Executes the block where the condition is true
D. Executes randomly
Correct Answer: C
Chapter: 119
Q1750:
What will be printed if marks is 60 in the following code: if (marks>=50) { print("You have passed"); } else { print("You have failed"); }?
A. "You have failed"
B. "You have passed"
C. "marks is not sufficient"
D. Nothing
Correct Answer: B
Chapter: 119
Q1751:
Fill in the blank: The statement if (marks >= 50) { print("You have passed"); } else { print("You have failed"); } will print "You have failed" if ______.
A. marks is greater than 50
B. marks is less than 50
C. marks is equal to 50
D. marks is greater than or equal to 50
Correct Answer: B
Chapter: 119
Q1752:
Which part of the if-else statement is executed when the condition is true?
A. The else block
B. Both StatementA and StatementB
C. The if block
D. None of the blocks
Correct Answer: C
Chapter: 119
Q1753:
Fill in the blank: The if (condition) StatementA else StatementB construct is used to ______.
A. Declare functions
B. Handle conditional logic
C. Initialize variables
D. Import modules
Correct Answer: B
Chapter: 119
Q1754:
What will happen if the condition in an if-else statement is false?
A. StatementA will be executed
B. StatementB will be executed
C. Both statements will be executed
D. The program will terminate
Correct Answer: B
Chapter: 119
Q1755:
In the if-else statement, what happens if the condition is not met?
A. StatementA is executed
B. The program stops
C. StatementB is executed
D. The condition is reassessed
Correct Answer: C
Chapter: 119
Q1756:
What is the result of the following pseudocode if marks is 45? if (marks>=50) { print("Pass"); } else { print("Fail"); }
A. "Pass"
B. "Fail"
C. "marks is not valid"
D. No output
Correct Answer: B
Chapter: 120
Q1757:
What will be the output if CGPA is 2.9 in the following code: if (CGPA>=3.0) { cout<<"Give Scholarship"; } else { cout<<"Sorry you do not qualify for the scholarship"; }?
A. "Give Scholarship"
B. "Sorry you do not qualify for the scholarship"
C. "Scholarship granted"
D. "No output"
Correct Answer: B
Chapter: 120
Q1758:
Fill in the blank: In the statement if (CGPA >= 3.0) { cout<<"Give Scholarship"; } else { cout<<"Sorry you do not qualify for the scholarship"; }, CGPA >= 3.0 is used to ______.
A. Assign a value to CGPA
B. Compare CGPA with 3.0
C. Print a message
D. Declare CGPA variable
Correct Answer: B
Chapter: 120
Q1759:
What will be printed if CGPA is 3.5 in the provided code?
A. "Give Scholarship"
B. "Sorry you do not qualify for the scholarship"
C. "Scholarship approved"
D. "Scholarship not applicable"
Correct Answer: A
Chapter: 120
Q1760:
Fill in the blank: The statement float f = 3.5; is used to ______.
A. Declare a variable
B. Compare values
C. Print messages
D. Assign scholarship eligibility
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Introduction to Computing

🚀 Start Quiz Now