Tayyari Karo Open the app

Matric Computer Science: Conditional Logic, questions with answers

Practise 16 real Federal Board questions on Conditional Logic from 2023 to 2025. See the answer and explanation as soon as you answer.

16real questions
5multiple choice
3exam sessions

About Conditional Logic in Matric Computer Science

Conditional Logic is one of the 9 main chapters in our Federal Board Matric Computer Science question bank (10th class), and about 5% of its real questions come from it. Tayyari Karo has 16 real questions on this chapter from 2023 to 2025; 5 are multiple choice and marked instantly, and the rest are short and long questions with a model answer. By difficulty: 14 easy, 2 medium.

Work through the questions below, then open the explanation for each one. Redo the ones you missed a few days later.

Try 8 real questions

These are real past-paper questions. Think of your answer first, then open the explanation.

2023 Annual · 10th · Conditional Logic

Which operators are used for building compound conditions?

  1. Relational
  2. Logical
  3. Arithmetic
  4. Assignment
Show answer and explanation

Answer: B. Logical

Logical operators (&&, ||, !) combine two or more relational conditions into one compound condition.

2023 Annual · 10th · Conditional Logic

________ statement is used to exit from the body of SWITCH statement.

  1. DEFAULT
  2. BREAK
  3. EXIT
  4. CONTINUE
Show answer and explanation

Answer: B. BREAK

The break statement terminates execution of the switch block and transfers control out of it.

2023 Annual · 10th · Conditional Logic

Which statement can be used in place of Conditional Operator?

  1. IF-ELSE
  2. Switch-case
  3. IF-ELSE-IF
  4. IF
Show answer and explanation

Answer: A. IF-ELSE

The ternary conditional operator (?:) is shorthand for a simple if-else statement.

2025 2nd Annual · 10th · Conditional Logic

Rewrite the following statement using if-else: k=(a+b>20)?a+3*b:a-b;

Show model answer

if (a + b > 20)
k = a + 3 * b;
else
k = a - b;

2025 2nd Annual · 10th · Conditional Logic

Write a C program that determines whether a number is even or odd using an if-else statement.

Show model answer

#include<stdio.h>
void main()
{
int num;
printf("Enter a number: ");
scanf("%d", &num);
if (num % 2 == 0)
printf("Even");
else
printf("Odd");
}

2024 Annual · 10th · Conditional Logic

Write down the use of default keyword in switch statement.

Show model answer

The default case in a switch statement holds the statements that execute when the switch expression's value does not match any of the listed case labels — it works like the “else” of a switch and is optional.

2024 Annual · 10th · Conditional Logic

What will be the output of the following code?
void main()
{
int a=2;
switch(a)
{
case 2: printf("Case 2"); break;
case 3: printf("Case 3"); break;
default: printf("Default\n");
}}

Show model answer

a is 2, so it matches case 2: it prints “Case 2” and the break exits the switch. Output: Case 2

2023 Annual · 10th · Conditional Logic

What is the use of the following in SWITCH statement? (a) CASE (b) BREAK (c) DEFAULT.

Show model answer

(a) case — labels each possible matching value of the switch expression, and marks the start of the statements to run for that value.
(b) break — ends execution of the switch block and prevents control from “falling through” into the next case.
(c) default — an optional case that runs when none of the listed case values match the switch expression.

Sessions with Conditional Logic questions

SessionQuestions
2025 2nd Annual5
2024 Annual5
2023 Annual6

Common questions

What does the Conditional Logic chapter cover on this page?

16 real Federal Board (FBISE) Computer Science questions on Conditional Logic from 2023 to 2025, for 10th class. Each one shows the session it came from.

Are the answers official?

No. We could not find an official FBISE marking scheme for these papers, so the answers and explanations are written by Tayyari Karo for practice. Check anything important with your teacher or textbook.

Is it free?

You can start free with no signup. A small set of papers per subject is free, and Premium unlocks the full question bank.

Other Computer Science chapters

All Matric Computer Science questions

Computer Science at other levels

Ready to start?

Free to start. No signup needed to try the questions.

Open Tayyari Karo