Tayyari Karo Open the app

Matric Computer Science: Introduction to Programming, questions with answers

Practise 26 real Federal Board questions on Introduction to Programming from 2023 to 2025. See the answer and explanation as soon as you answer.

26real questions
8multiple choice
3exam sessions

About Introduction to Programming in Matric Computer Science

Introduction to Programming is one of the 9 main chapters in our Federal Board Matric Computer Science question bank (10th class), and about 8% of its real questions come from it. Tayyari Karo has 26 real questions on this chapter from 2023 to 2025; 8 are multiple choice and marked instantly, and the rest are short and long questions with a model answer. By difficulty: 18 easy, 8 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.

2025 2nd Annual · 10th · Introduction to Programming

Which keyword is used to declare a constant variable in C?

  1. int
  2. var
  3. const
  4. static
Show answer and explanation

Answer: C. const

The const keyword is used to declare a variable whose value cannot be changed after initialisation.

2025 2nd Annual · 10th · Introduction to Programming

The output of the following statement is: printf("%d", 5+2);

  1. 7
  2. 5+2
  3. error
  4. %d7
Show answer and explanation

Answer: A. 7

5+2 evaluates to 7 and %d formats it as an integer, so the output is 7.

2025 2nd Annual · 10th · Introduction to Programming

Which function is used for input handling in C?

  1. scanf()
  2. printf()
  3. cin>>
  4. system()
Show answer and explanation

Answer: A. scanf()

scanf() is the standard C library function used to read input from the keyboard.

2024 Annual · 10th · Introduction to Programming

The output of the following statement is: printf("%d", 5+2);

  1. 7
  2. 5+2
  3. error
  4. %d7
Show answer and explanation

Answer: A. 7

5+2 evaluates to 7, and %d prints it as an integer, so the output is 7.

2024 Annual · 10th · Introduction to Programming

Which function is used for input handling in C?

  1. scanf()
  2. printf()
  3. cin>>
  4. system()
Show answer and explanation

Answer: A. scanf()

scanf() reads (takes) input from the keyboard in C; printf() is for output, cin>> is C++.

2023 Annual · 10th · Introduction to Programming

________ is a software that loads a program into memory and then executes it.

  1. Linker
  2. Loader
  3. Compiler
  4. Debugger
Show answer and explanation

Answer: B. Loader

A loader copies an executable program from storage into main memory and starts its execution; a linker combines object modules, a compiler translates source code.

2025 2nd Annual · 10th · Introduction to Programming

Give the significance of #include in C programming.

Show model answer

#include<stdio.h> is a preprocessor directive that tells the compiler to include the Standard Input Output header file, which contains the declarations of standard I/O functions such as printf() and scanf(). Without it, using these functions would cause compile errors.

2024 Annual · 10th · Introduction to Programming

Correct any four errors in the given code:
1 void main();
2 {
3 int marks
4 printf("Enter marks");
5 scanf("%d", marks);
6 if (m<32);
7 printf("Pass");
8 }

Show model answer

(1) Line 1: void main(); has an extra semicolon — should be void main().
(2) Line 3: int marks is missing a semicolon — should be int marks;.
(3) Line 5: scanf("%d", marks); is missing the address-of operator — should be scanf("%d", &marks);.
(4) Line 6: if (m<32); uses an undeclared variable m (should be marks) and has a stray semicolon that makes the if do nothing — should be if (marks<32) (no semicolon) so line 7 belongs to it.

Sessions with Introduction to Programming questions

SessionQuestions
2025 2nd Annual9
2024 Annual12
2023 Annual5

Common questions

What does the Introduction to Programming chapter cover on this page?

26 real Federal Board (FBISE) Computer Science questions on Introduction to Programming 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