MCQ Quiz - Class 8 - Decision Control Structure

MCQ Quiz — Decision Control Structure
Test Your Knowledge — Think, Code and Grow! This comprehensive quiz contains 20 Multiple Choice Questions covering if statements, if-else, nested if, else-if ladder, logical operators, and best practices. Check your answers with detailed explanations!
Quiz Instructions
Read Carefully
- ✓ 20 Multiple Choice Questions.
- ✓ Each question has 4 options (A, B, C, D).
- ✓ Choose the correct answer.
- ✓ Each correct answer = 5 Marks.
- ✓ Total Marks = 100.
- ✓ Duration: 30-40 minutes.
- ✓ Topics: if, if-else, nested if, else-if ladder, operators.
What is Decision Control Structure?
A Decision Control Structure is a programming construct that allows a program to make decisions and execute different code based on conditions.
Section 1: Basics (Q1-Q4)
Question 1
What does decision control structure do?
A. Loop code
B. Make decisions based on conditions
C. Print output
D. Store data
Question 2
Which is a decision statement?
A. for
B. while
C. if
D. do-while
if is a decision
statement. for, while, and do-while are loop (iteration)
statements.
Question 3
What is the correct syntax of if?
A. if condition
B. if (condition)
C. if [condition]
D. if {condition}
if (condition) — condition inside parentheses.
Question 4
Which operator is used for comparison?
A. =
B. ==
C. !=
D. =!
== compares two
values for equality. = is assignment.
!= is "not equal to". =! is
invalid.
Section 2: Operators (Q5-Q7)
Question 5
What does && represent?
A. OR
B. AND
C. NOT
D. XOR
&& is the
logical AND operator. Both conditions must be true for the
result to be true.
Question 6
What does || represent?
A. AND
B. OR
C. NOT
D. XOR
|| is the logical
OR operator. If at least one condition is true, the result
is true.
Question 7
What does ! operator do?
A. Adds
B. Reverses condition
C. Compares
D. Assigns
! is the NOT
operator — it reverses the condition. If a condition is
true, !condition becomes false, and vice versa.
Section 3: if-else & Ladder (Q8-Q10)
Question 8
In if-else, when does else execute?
A. When condition is true
B. When condition is false
C. Always
D. Never
Question 9
What is else-if ladder used for?
A. Loops
B. Multiple conditions
C. Storage
D. Printing
Question 10
In nested if:
A. if inside for
B. if inside if
C. if inside while
D. if inside switch
Section 4: Output Prediction (Q11-Q13)
Question 11
Output of: if(10>5) print('YES'); else print('NO');
A. NO
B. YES
C. Error
D. Nothing
10 > 5 is
TRUE. So the if block executes, printing "YES".
Question 12
Output of: int x=0; if(x) print('T'); else print('F');
A. T
B. F
C. 0
D. Error
if(x) checks if x is non-zero (true). Since
x=0 (false), the else block executes, printing "F". Note:
In Java, you'd need if (x != 0).
Question 13
What is the value of 5 % 2?
A. 0
B. 1
C. 2
D. 2.5
% gives the remainder. 5 ÷ 2 = 2 remainder 1.
So 5 % 2 = 1.
Section 5: Operators & Best Practices (Q14-Q20)
Question 14
Which is NOT a logical operator?
A. &&
B. ||
C. !
D. +
+ is an
arithmetic operator (addition). The logical operators are
&& (AND), || (OR), and
! (NOT).
Question 15
Which is a comparison operator?
A. =
B. +
C. >=
D. &&
>= (greater
than or equal to) is a comparison operator. =
is assignment, + is arithmetic,
&& is logical.
Question 16
Should braces be used for single statement?
A. Never
B. Yes, always recommended
C. Only for if
D. Only for else
Question 17
What happens with = instead of == in condition?
A. Compares
B. Assigns value
C. Error
D. Nothing
= is assignment,
not comparison. So if (x = 5) assigns 5 to x
(not compares). This is a very common bug!
Question 18
Which best describes if statement?
A. Loop
B. Conditional statement
C. Data type
D. Variable
if statement
is a conditional statement — it executes code based on a
condition. It's not a loop, data type, or variable.
Question 19
Best practice for decision statements?
A. Deep nesting
B. Clear conditions and proper indentation
C. No else block
D. Skip braces
Question 20
Which condition is TRUE when age is 18?
A. age < 18
B. age >= 18
C. age > 20
D. age == 25
- A. 18 < 18 → FALSE
- B. 18 >= 18 → TRUE ✓
- C. 18 > 20 → FALSE
- D. 18 == 25 → FALSE
Complete Answer Key
| Q.No. | Answer | Q.No. | Answer |
|---|---|---|---|
| 1 | B | 11 | B |
| 2 | C | 12 | B |
| 3 | B | 13 | B |
| 4 | B | 14 | D |
| 5 | B | 15 | C |
| 6 | B | 16 | B |
| 7 | B | 17 | B |
| 8 | B | 18 | B |
| 9 | B | 19 | B |
| 10 | B | 20 | B |
Quick Tips for MCQs
How to Ace MCQs
- ⭐ Read question carefully.
- ⭐ Check all options before choosing.
- ⭐ Look for keywords in the question.
- ⭐ Eliminate wrong options.
- ⭐ Verify with logic.
- ⭐ Practice more MCQs regularly.
- ⭐ Learn from your mistakes.
- ⭐ Don't rush — think first.
Scoring Guide
| Score | Grade | Comment |
|---|---|---|
| 90-100 | A+ Excellent! | Programming Master! 🏆 |
| 75-89 | A Very Good! | Strong understanding! 🌟 |
| 60-74 | B Good! | Well done! 👍 |
| 50-59 | C Average | Keep learning! 📚 |
| Below 50 | Needs Practice | Review the chapter! 💪 |
Did You Know?
Fun Fact
Decision statements are the foundation of programming logic! Master them and you can write any complex program! From simple calculators to advanced AI systems — everything uses if-else logic underneath!
Quick Revision Points
| Concept | Key Point |
|---|---|
| if | Executes code when condition is true |
| if-else | Two-way decision (true/false) |
| Nested if | if inside another if |
| else-if Ladder | Multiple conditions in sequence |
| == operator | Comparison (not assignment) |
| = | Assignment (not comparison) |
| && (AND) | Both must be true |
| || (OR) | At least one must be true |
| ! (NOT) | Reverses the condition |
| Modulo % | Gives remainder |
Frequently Asked Questions
Q1. How do I remember all these operators?
Practice! Write small programs using each operator. The more you use them, the more you'll remember.
Q2. What's the difference between = and ==?
= assigns a value (x = 5 means x becomes 5).
== compares (x == 5 checks if x equals 5).
Q3. When should I use && vs ||?
Use && when ALL conditions must be true.
Use || when AT LEAST ONE condition must be
true.
Q4. Why do I need braces { }?
Braces group multiple statements together. Even for single statements, use them to avoid bugs when adding more code.
Q5. What's the difference between if-else and else-if?
if-else has only ONE condition (two paths). else-if allows MULTIPLE conditions in a chain.
Q6. How do I check output prediction questions?
Trace through the code line-by-line. Check each condition with the given values. See which block executes.
Q7. Can I skip questions I don't know?
Try to answer all questions. Guess if unsure — no negative marking usually. Come back if time allows.
Q8. How do I improve my score?
Practice more MCQs, understand concepts thoroughly, write real programs, and learn from your mistakes.
Key Takeaways
- Decision control makes programs smart.
- Use == for comparison, = for assignment.
- && = AND, || = OR, ! = NOT.
- if-else has 2 paths; else-if ladder has multiple.
- Nested if = if inside if.
- Always use braces { }.
- Modulo % gives remainder.
- Practice makes perfect.
- Understand concepts, don't just memorize.
- Test your code with different inputs.
Key Takeaway
MCQs test both theory and application!
Practice regularly to master decision control
statements!
Congratulations on completing this quiz! Whether you
scored 100 or need more practice, keep learning. Every
question you answer builds your programming skills.
Test Your Knowledge — Think, Code and
Grow!
⭐ CODE SMART, THINK CLEAR, WRITE BETTER! ⭐
Best of Luck! Take your time. Think
carefully. You will do great! 👍😊
Flowchart → Visual Thinking → Smart Solutions → Better
Results! 🚀
Master This Topic with Smart Practice
Reinforce what you just learned by solving high-quality MCQs. Improve accuracy, boost confidence, and prepare like a topper.
Home & Online Tuition
Learn from an experienced tutor with personalized guidance.
Available Locations
Expert Home & Online Tuition
Personalized one-to-one tuition that focuses on concept building, practical learning, problem-solving skills, and excellent academic performance. Suitable for school students looking for structured, interactive, and result-oriented learning.
Subjects We Teach
Why Choose Our Tuition?
✅ Concept-Based Learning
✅ Practical Examples
✅ Weekly Tests
✅ Doubt Solving Sessions
✅ Practice Worksheets
✅ MCQ & Assignments
✅ Exam Preparation
✅ Flexible Class Timings