Table of Contents

    MCQ Quiz - Class 8 - Decision Control Structure

    MCQ Quiz - Class 8 - Decision Control Structure
    Figure: MCQ Quiz - Class 8 - Decision Control Structure

    MCQ QUIZ — CLASS 8

    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.
    Best of Luck! 🏆 Take your time, think carefully, and give your best!

    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.

    DECISION FLOW
    ConditionTrue / FalseDifferent Actions

    Section 1: Basics (Q1-Q4)

    Question 1

    1

    What does decision control structure do?

    5 Marks

    A. Loop code
    B. Make decisions based on conditions
    C. Print output
    D. Store data

    Answer: B — Make decisions based on conditions Explanation: Decision control structures like if, if-else, and switch help programs make choices based on conditions. Loops are for repetition; print is for output.

    Question 2

    2

    Which is a decision statement?

    5 Marks

    A. for
    B. while
    C. if
    D. do-while

    Answer: C — if Explanation: if is a decision statement. for, while, and do-while are loop (iteration) statements.

    Question 3

    3

    What is the correct syntax of if?

    5 Marks

    A. if condition
    B. if (condition)
    C. if [condition]
    D. if {condition}

    Answer: B — if (condition) Explanation: In Java, the correct syntax is if (condition) — condition inside parentheses.

    Question 4

    4

    Which operator is used for comparison?

    5 Marks

    A. =
    B. ==
    C. !=
    D. =!

    Answer: B — == Explanation: == compares two values for equality. = is assignment. != is "not equal to". =! is invalid.

    Section 2: Operators (Q5-Q7)

    Question 5

    5

    What does && represent?

    5 Marks

    A. OR
    B. AND
    C. NOT
    D. XOR

    Answer: B — AND Explanation: && is the logical AND operator. Both conditions must be true for the result to be true.

    Question 6

    6

    What does || represent?

    5 Marks

    A. AND
    B. OR
    C. NOT
    D. XOR

    Answer: B — OR Explanation: || is the logical OR operator. If at least one condition is true, the result is true.

    Question 7

    7

    What does ! operator do?

    5 Marks

    A. Adds
    B. Reverses condition
    C. Compares
    D. Assigns

    Answer: B — Reverses condition Explanation: ! 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

    8

    In if-else, when does else execute?

    5 Marks

    A. When condition is true
    B. When condition is false
    C. Always
    D. Never

    Answer: B — When condition is false Explanation: The else block executes only when the if condition evaluates to false.

    Question 9

    9

    What is else-if ladder used for?

    5 Marks

    A. Loops
    B. Multiple conditions
    C. Storage
    D. Printing

    Answer: B — Multiple conditions Explanation: else-if ladder is used to check multiple conditions in sequence. Example: grade calculation (A, B, C, D, F).

    Question 10

    10

    In nested if:

    5 Marks

    A. if inside for
    B. if inside if
    C. if inside while
    D. if inside switch

    Answer: B — if inside if Explanation: Nested if means an if statement is placed inside another if statement — creating multiple levels of conditions.

    Section 4: Output Prediction (Q11-Q13)

    Question 11

    11

    Output of: if(10>5) print('YES'); else print('NO');

    5 Marks

    A. NO
    B. YES
    C. Error
    D. Nothing

    Answer: B — YES Explanation: 10 > 5 is TRUE. So the if block executes, printing "YES".

    Question 12

    12

    Output of: int x=0; if(x) print('T'); else print('F');

    5 Marks

    A. T
    B. F
    C. 0
    D. Error

    Answer: B — F Explanation: In this pseudocode context, 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

    13

    What is the value of 5 % 2?

    5 Marks

    A. 0
    B. 1
    C. 2
    D. 2.5

    Answer: B — 1 Explanation: The modulo operator % gives the remainder. 5 ÷ 2 = 2 remainder 1. So 5 % 2 = 1.

    Section 5: Operators & Best Practices (Q14-Q20)

    Question 14

    14

    Which is NOT a logical operator?

    5 Marks

    A. &&
    B. ||
    C. !
    D. +

    Answer: D — + Explanation: + is an arithmetic operator (addition). The logical operators are && (AND), || (OR), and ! (NOT).

    Question 15

    15

    Which is a comparison operator?

    5 Marks

    A. =
    B. +
    C. >=
    D. &&

    Answer: C — >= Explanation: >= (greater than or equal to) is a comparison operator. = is assignment, + is arithmetic, && is logical.

    Question 16

    16

    Should braces be used for single statement?

    5 Marks

    A. Never
    B. Yes, always recommended
    C. Only for if
    D. Only for else

    Answer: B — Yes, always recommended Explanation: Best practice is to always use braces { } — even for single statements. This prevents bugs when you add more code later.

    Question 17

    17

    What happens with = instead of == in condition?

    5 Marks

    A. Compares
    B. Assigns value
    C. Error
    D. Nothing

    Answer: B — Assigns value Explanation: = is assignment, not comparison. So if (x = 5) assigns 5 to x (not compares). This is a very common bug!

    Question 18

    18

    Which best describes if statement?

    5 Marks

    A. Loop
    B. Conditional statement
    C. Data type
    D. Variable

    Answer: B — Conditional statement Explanation: An if statement is a conditional statement — it executes code based on a condition. It's not a loop, data type, or variable.

    Question 19

    19

    Best practice for decision statements?

    5 Marks

    A. Deep nesting
    B. Clear conditions and proper indentation
    C. No else block
    D. Skip braces

    Answer: B — Clear conditions and proper indentation Explanation: Best practices include: clear meaningful conditions, proper indentation, using braces, handling all cases, and avoiding deep nesting.

    Question 20

    20

    Which condition is TRUE when age is 18?

    5 Marks

    A. age < 18
    B. age >= 18
    C. age > 20
    D. age == 25

    Answer: B — age >= 18 Explanation: When age = 18:
    • 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
    1B11B
    2C12B
    3B13B
    4B14D
    5B15C
    6B16B
    7B17B
    8B18B
    9B19B
    10B20B

    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
    ifExecutes code when condition is true
    if-elseTwo-way decision (true/false)
    Nested ifif inside another if
    else-if LadderMultiple conditions in sequence
    == operatorComparison (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! 🚀

    Practice Quiz 87 MCQs Smart Learning

    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.

    Topic-wise MCQs
    Instant Results
    Improve Accuracy
    Exam Ready Practice
    Login & Start Quiz Create Free Account
    Save progress • Track results • Learn faster