Introduction to Computing MCQs with Answers
Practice important Introduction to Computing MCQs with answers and explanations.
Chapter: 124
Q1801:
What does the relational operator <= mean in C++?
A. Less than or equal to
B. Greater than or equal to
C. Equal to
D. Not equal to
Correct Answer:
A
Chapter: 124
Q1802:
Which relational operator is used to check if two variables are not equal in C++?
A. =
B. ==
C. !=
D. <=
Correct Answer:
C
Chapter: 124
Q1803:
In C++, what will if(a<=c) do if a and c are equal?
A. It will print "a is greater"
B. It will print "a is smaller"
C. It will print "a is less than/equal to c"
D. It will not print anything
Correct Answer:
C
Chapter: 124
Q1804:
Fill in the blank: The relational operator > checks if one value is _______ than another.
A. Less
B. Equal
C. Greater
D. Not equal
Correct Answer:
C
Chapter: 124
Q1805:
What will be the output of the following code snippet if a=10 and b=20?
A. a is smaller, a is greater
B. a is greater, a is smaller
C. a is smaller, a is less than/equal to c
D. a is smaller, a is greater than/equal to c
Correct Answer:
C
Chapter: 124
Q1806:
What does the relational operator == do in C++?
A. Checks if two values are not equal
B. Checks if two values are equal
C. Checks if one value is greater than the other
D. Checks if one value is less than the other
Correct Answer:
B
Chapter: 124
Q1807:
Fill in the blank: The relational operator != checks if two values are _______ in C++.
A. Equal
B. Not equal
C. Less than
D. Greater than
Correct Answer:
B
Chapter: 124
Q1808:
In the provided code, what will if(num1!=num2) output if num1 = 30 and num2 = 40?
A. num1 Is Not Equal To num2
B. num2 Is Equal To num3
C. num1 Is Equal To num2
D. num2 Is Not Equal To num3
Correct Answer:
A
Chapter: 124
Q1809:
What is the result of if(num2==num3) when num2 = 40 and num3 = 40 in C++?
A. The output will be "num2 Is Not Equal To num3"
B. The output will be "num1 Is Equal To num2"
C. The output will be "num2 Is Equal To num3"
D. The output will be "num1 Is Not Equal To num2"
Correct Answer:
C
Chapter: 124
Q1810:
Fill in the blank: In C++, relational operators return _______ based on the comparison of values.
A. 0 or 1
B. True or False
C. A string
D. A character
Correct Answer:
A
Chapter: 124
Q1811:
What is the output of the following code if a=10, b=20, and c=10?
A. a is smaller, a is less than/equal to c, a is greater than/equal to c
B. a is greater, a is less than/equal to c, a is smaller
C. a is greater, a is smaller, a is less than/equal to c
D. a is less than/equal to c, a is smaller, a is greater
Correct Answer:
A
Chapter: 124
Q1812:
What is the output of the if(a>=c) statement when a is equal to c?
A. a is greater than/equal to c
B. a is less than/equal to c
C. a is smaller
D. No output
Correct Answer:
A
Chapter: 125
Q1813:
What does the AND operator require for the output to be 1?
A. Both conditions are False
B. At least one condition is True
C. Both conditions are True
D. At least one condition is False
Correct Answer:
C
Chapter: 125
Q1814:
Which logical operator in C++ inverts the output?
A. AND
B. OR
C. NOT
D. BOTH
Correct Answer:
C
Chapter: 125
Q1815:
In the given C++ code, what is the output of the statement `if(num1>=40 || num2>=40)` when `num1=30` and `num2=40`?
A. OR If Block Gets Executed
B. AND If Block Gets Executed
C. NOT If Block Gets Executed
D. No Output
Correct Answer:
A
Chapter: 125
Q1816:
In the provided code, what is the condition that causes the NOT operator block to execute?
A. `num1>=40`
B. `num1<40`
C. `num2>=40`
D. `num2<40`
Correct Answer:
B
Chapter: 125
Q1817:
What will be the output of the statement `if(num1>=20 && num2>=20)` if `num1=30` and `num2=40`?
A. OR If Block Gets Executed
B. AND If Block Gets Executed
C. NOT If Block Gets Executed
D. No Output
Correct Answer:
B
Chapter: 125
Q1818:
How many logical operators are used in the given C++ code?
A. One
B. Two
C. Three
D. Four
Correct Answer:
C
Chapter: 125
Q1819:
What will the `cout` statement print if the condition `!(num1>=40)` is satisfied with `num1=30`?
A. OR If Block Gets Executed
B. AND If Block Gets Executed
C. NOT If Block Gets Executed
D. No Output
Correct Answer:
C
Chapter: 126
Q1820:
What is a major challenge in software engineering compared to traditional engineering disciplines?
A. Using off-the-shelf components
B. Quantifying software properties
C. Designing new components
D. Managing project resources
Correct Answer:
B