Introduction to Computing MCQs with Answers
Practice important Introduction to Computing MCQs with answers and explanations.
Multiple Choice Questions
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
View Answer
B
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
View Answer
B
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 :=
View Answer
A
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
View Answer
B
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);
View Answer
B
Q1746: What does a control statement do in programming?
- A: Alters the execution sequence
- B: Declares variables
- C: Defines functions
- D: Imports libraries
View Answer
A
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
View Answer
C
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
View Answer
B
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
View Answer
C
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
View Answer
B