Programming is an important part of Computer Science preparation for Bihar STET 2026. This topic includes programming fundamentals, variables, data types, operators, control statements, functions, arrays, strings, pointers, recursion, object-oriented programming and basic programming concepts.
Important Programming Topics
- Programming Fundamentals
- Algorithms and Flowcharts
- Variables and Constants
- Data Types
- Operators
- Input and Output
- Conditional Statements
- Loops
- Functions
- Arrays
- Strings
- Pointers
- Recursion
- Structures and Unions
- Object-Oriented Programming
- Classes and Objects
- Inheritance
- Polymorphism
- Encapsulation
- Exception Handling
Programming Fundamentals
A program is a sequence of instructions written in a programming language to perform a specific task.
Programming Language
A programming language provides rules and syntax for writing computer programs.
Programming languages can broadly include:
- Machine Language
- Assembly Language
- High-Level Languages
Compiler
A compiler translates a program written in a high-level language into a lower-level form, often producing machine code or an intermediate representation.
Interpreter
An interpreter executes program instructions through an interpretation process, typically without producing a standalone machine-code executable in the traditional compilation model.
Variables
A variable is a named storage location used to hold a value that may change during program execution.
Example in C:
int age = 25;
Here:
-
int→ data type -
age→ variable -
25→ value
Constants
A constant represents a value that does not change during the relevant program execution.
Example:
const float PI = 3.14159;
Data Types
Common basic data types in C/C++ include:
-
int -
char -
float -
double -
void
Other languages may provide additional types such as:
- Boolean
- String
- Object
- List
Operators
Operators are symbols used to perform operations.
Arithmetic Operators
+, -, *, /, %
Relational Operators
<, >, <=, >=, ==, !=
Logical Operators
&&, ||, !
Assignment Operators
=, +=, -=, *=, /=
Increment and Decrement
++, --
Conditional Statements
Conditional statements allow a program to make decisions.
if Statement
if (age >= 18){printf("Eligible");}
if-else
if (a > b)printf("A is greater");elseprintf("B is greater");
switch Statement
switch is commonly used when one expression is compared against multiple constant cases.
Loops
Loops are used to execute a block of code repeatedly.
for Loop
Useful when the number of iterations is known or controlled by a loop condition.
while Loop
The condition is checked before each iteration.
do-while Loop
The loop body executes at least once because the condition is checked after the body.
Functions
A function is a reusable block of code designed to perform a particular task.
Functions improve:
- Modularity
- Reusability
- Readability
- Maintainability
A function can have:
- Parameters
- Return value
Arrays
An array stores a collection of elements of the same data type in contiguous memory in languages such as C.
Example:
int marks[5];
An array can be:
- One-dimensional
- Two-dimensional
- Multidimensional
Strings
A string represents a sequence of characters.
In C, a string is stored as a character array terminated by the null character:
'\0'
Example:
char name[] = "Bihar";
Pointers
A pointer is a variable that stores a memory address.
Example:
int x = 10;int *p = &x;
Here, p stores the address of x.
Important operators:
-
&→ address-of -
*→ dereference
Recursion
Recursion occurs when a function calls itself.
A recursive function should have a base case to stop further recursive calls.
Example:
int factorial(int n){if (n == 0)return 1;return n * factorial(n - 1);}
Object-Oriented Programming
Object-Oriented Programming (OOP) organizes software around objects and classes.
Important concepts include:
Class
A class is a blueprint or definition used to create objects.
Object
An object is an instance of a class.
Encapsulation
Bundling data and methods together while controlling access to internal details.
Inheritance
A mechanism through which a class can acquire properties and behavior from another class.
Polymorphism
The ability to use a common interface for different underlying implementations.
Abstraction
Representing essential features while hiding unnecessary implementation details.
Important Programming MCQs for Bihar STET 2026
1. What is a program?
A. A hardware component
B. A sequence of instructions to perform a task
C. A memory device
D. A network protocol
Answer: B. A sequence of instructions to perform a task
2. Which language is directly understood by the processor?
A. High-level language
B. Machine language
C. SQL
D. HTML
Answer: B. Machine language
3. Which software translates a high-level program into machine-oriented code?
A. Compiler
B. Browser
C. Editor
D. Loader only
Answer: A. Compiler
4. Which of the following is a basic data type in C?
A. int
B. class
C. package
D. object
Answer: A. int
5. Which operator is used for modulus in C?
A. /
B. *
C. %
D. #
Answer: C. %
6. Which operator represents logical AND in C?
A. &
B. &&
C. ||
D. !
Answer: B. &&
7. Which operator represents logical OR in C?
A. &&
B. ||
C. !
D. &
Answer: B. ||
8. Which statement is commonly used for decision-making?
A. if
B. for
C. continue
D. return
Answer: A. if
9. Which loop is guaranteed to execute its body at least once?
A. for
B. while
C. do-while
D. None
Answer: C. do-while
10. Which statement is used to select among multiple cases?
A. if
B. switch
C. loop
D. goto only
Answer: B. switch
11. Which keyword is used to return a value from a C function?
A. break
B. return
C. exit
D. continue
Answer: B. return
12. What is an array?
A. Collection of elements generally of the same type
B. A single operator
C. A programming language
D. A compiler
Answer: A. Collection of elements generally of the same type
13. The first index of a C array is generally:
A. 0
B. 1
C. -1
D. 2
Answer: A. 0
14. In C, a string is terminated by:
A. '\n'
B. '\0'
C. '\t'
D. EOF
Answer: B. '\0'
15. What does a pointer store?
A. Only integer values
B. A memory address
C. A program name
D. A data type
Answer: B. A memory address
16. Which operator gives the address of a variable in C?
A. *
B. &
C. %
D. #
Answer: B. &
17. Which operator is used for pointer dereferencing in C?
A. &
B. *
C. -> only
D. %
**Answer: B. ***
18. A function calling itself is known as:
A. Iteration
B. Recursion
C. Compilation
D. Encapsulation
Answer: B. Recursion
19. A recursive function must generally have:
A. A base case
B. Only a pointer
C. A switch statement
D. A class
Answer: A. A base case
20. Which concept is associated with OOP?
A. Encapsulation
B. Compilation only
C. Linking only
D. Assembly
Answer: A. Encapsulation
21. An object is generally:
A. An instance of a class
B. A compiler
C. A data type only
D. A loop
Answer: A. An instance of a class
22. Which OOP concept allows a class to acquire properties and behavior from another class?
A. Encapsulation
B. Inheritance
C. Abstraction
D. Compilation
Answer: B. Inheritance
23. Which OOP concept refers to one interface supporting different implementations?
A. Inheritance
B. Polymorphism
C. Compilation
D. Recursion
Answer: B. Polymorphism
24. Which OOP concept hides unnecessary implementation details?
A. Abstraction
B. Looping
C. Inheritance only
D. Compilation
Answer: A. Abstraction
25. Which feature helps organize data and related methods into a single unit?
A. Encapsulation
B. Recursion
C. Iteration
D. Searching
Answer: A. Encapsulation
26. Which statement immediately terminates the current loop or switch in C?
A. continue
B. break
C. return only
D. goto only
Answer: B. break
27. Which statement skips the remaining statements of the current loop iteration?
A. break
B. continue
C. switch
D. exit
Answer: B. continue
28. Which loop is commonly preferred when the number of iterations is known?
A. for
B. while
C. do-while
D. switch
Answer: A. for
29. Which of the following is NOT an arithmetic operator?
A. +
B. -
C. *
D. &&
Answer: D. &&
30. Which programming concept divides a program into reusable blocks?
A. Function
B. Variable
C. Constant
D. Operator
Answer: A. Function
Quick Revision
- Program → Set of instructions to perform a task.
- Compiler → Translates source code into a target form.
- Variable → Named storage whose value can change.
- Constant → Value intended not to change.
- Array → Collection of elements of the same type in C.
-
String in C → Character array ending with
'\0'. - Pointer → Stores a memory address.
- Function → Reusable block of code.
- Recursion → Function calls itself.
- Class → Blueprint/definition for objects.
- Object → Instance of a class.
- Inheritance → Acquiring properties/behavior from another class.
- Polymorphism → One interface with multiple implementations.
- Encapsulation → Bundling data and methods with controlled access.
- Abstraction → Hiding unnecessary implementation details.
Bihar STET Preparation Focus
For Bihar STET Computer Science 2026, focus on programming fundamentals, C/C++ concepts, data types, operators, control statements, loops, functions, arrays, strings, pointers, recursion and OOP concepts. Practice output-based and conceptual MCQs regularly for better performance in the examination.