Which keyword is used to declare a constant variable in C?
- int
- var
- const
- static
Show answer and explanation
Answer: C. const
The const keyword is used to declare a variable whose value cannot be changed after initialisation.
Practise 26 real Federal Board questions on Introduction to Programming from 2023 to 2025. See the answer and explanation as soon as you answer.
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.
These are real past-paper questions. Think of your answer first, then open the explanation.
Which keyword is used to declare a constant variable in C?
Answer: C. const
The const keyword is used to declare a variable whose value cannot be changed after initialisation.
The output of the following statement is: printf("%d", 5+2);
Answer: A. 7
5+2 evaluates to 7 and %d formats it as an integer, so the output is 7.
Which function is used for input handling in C?
Answer: A. scanf()
scanf() is the standard C library function used to read input from the keyboard.
The output of the following statement is: printf("%d", 5+2);
Answer: A. 7
5+2 evaluates to 7, and %d prints it as an integer, so the output is 7.
Which function is used for input handling in C?
Answer: A. scanf()
scanf() reads (takes) input from the keyboard in C; printf() is for output, cin>> is C++.
________ is a software that loads a program into memory and then executes it.
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.
Give the significance of #include in C programming.
#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.
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 }
(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.
| Session | Questions |
|---|---|
| 2025 2nd Annual | 9 |
| 2024 Annual | 12 |
| 2023 Annual | 5 |
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.
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.
You can start free with no signup. A small set of papers per subject is free, and Premium unlocks the full question bank.