- 1Programming ConceptWrite a Program to print Prime numbers from 1 to n.
#include <iostream> using namespace std; int main() { int i, num, n, count; cout << "Enter the range: "; cin >> n; cout << "The prime numbers in between the range 1 to " << n << " are: "; for (num = 1; num <= n; num++) { count = 0; for (i = 2; i <= num / 2; i++) { if (num % i == 0) { count++; break; } } if (count == 0 && num != 1) cout << num << " "; } return 0; }Sample I/O: Enter the range: 50 The prime numbers in between the range 1 to 50 are: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 === Code Execution Successful ===🔗 Run Online: Prime number between range
- 2Programming ConceptWrite a Program to print Floyd's Triangle for n = 5.
Expected Output:
1
01
101
0101
10101#include <iostream> using namespace std; int main() { int i, j, n, p, q; cout << "Input number of rows: "; cin >> n; for (i = 1; i <= n; i++) { if (i % 2 == 0) { p = 1; q = 0; } else { p = 0; q = 1; } for (j = 1; j <= i; j++) { if (j % 2 == 0) cout << p; else cout << q; } cout << endl; } return 0; }Sample I/O: Input number of rows: 6 1 01 101 0101 10101 010101 === Code Execution Successful ===🔗 Run Online: Floyd's Triangle
- 3Programming ConceptWrite a C++ program to find the sum of the series: 1 + 2 + 4 + 7 + 11 + ... + N.
#include <iostream> using namespace std; int main() { int n, i, sum = 0, term = 1, nextTerm; cout << "Enter the value of n: "; cin >> n; cout << "The series is: "; for (i = 1; i <= n; i++) { cout << term << " "; sum += term; nextTerm = term + i; term = nextTerm; } cout << "\nThe sum of the series is: " << sum << endl; return 0; }Sample I/O: Enter the value of n: 10 The series is: 1 2 4 7 11 16 22 29 37 46 The sum of the series is: 175 === Code Execution Successful ===🔗 Run Code: Sum of series: 1+2+4+7+11+...+N - 4Programming ConceptFind the output of the following recursion:
#include <stdio.h>
void fun(int x){
if(x<0){
return;
}
printf("%d\n", x--);
fun(--x);
printf("%d\n", x);
}
int main() {
fun(5);
return 0;
}
Step-by-Step Execution
Initial call:
fun(5)x = 5- Print
5 x--(post-decrement) → Passx = 4tofun(--x)
Recursive call:
fun(3)x = 3- Print
3 x--(post-decrement) → Passx = 2tofun(--x)
Recursive call:
fun(1)x = 1- Print
1 x--(post-decrement) → Passx = 0tofun(--x)
Recursive call:
fun(-1)x = -1- The
if(x<0) return;triggers, stopping recursion. - Nothing is printed here.
Returning from
fun(1):x = -1at this point (becausexwas decremented before recursion)- Print
-1
Returning from
fun(3):x = 1- Print
1
Returning from
fun(5):x = 3- Print
3
- 5Object Oriented ProgrammingBasicWhat is Polymorphism? Discuss different types of Polymorphism with examples.
Polymorphism means “having many forms.” It allows the same method or function to perform different tasks based on the context. In simpler terms, it enables a single interface to represent different functionalities.
Polymorphism can be broadly categorized into two types:
- Compile-time Polymorphism (Static Polymorphism)
- Runtime Polymorphism (Dynamic Polymorphism)
1. Compile-time Polymorphism (Static Polymorphism)
Compile-time polymorphism is achieved through method overloading and operator overloading. The method to be executed is determined at compile time based on the method signature.
2. Runtime Polymorphism (Dynamic Polymorphism)
Runtime polymorphism is achieved through method overriding. The method to be executed is determined at runtime based on the object being referred to.
🎥 Video Solution: Polymorphism & its types.
Polymorphism means “having many forms.” It allows the same method or function to perform different tasks based on the context. In simpler terms, it enables a single interface to represent different functionalities.
Polymorphism can be broadly categorized into two types:
- Compile-time Polymorphism (Static Polymorphism)
- Runtime Polymorphism (Dynamic Polymorphism)
1. Compile-time Polymorphism (Static Polymorphism)
Compile-time polymorphism is achieved through method overloading and operator overloading. The method to be executed is determined at compile time based on the method signature.
2. Runtime Polymorphism (Dynamic Polymorphism)
Runtime polymorphism is achieved through method overriding. The method to be executed is determined at runtime based on the object being referred to.
🎥 Video Solution: Polymorphism & its types.
- 6Operating SystemMultithreadingWhat is Multithreading programming? Why is Multithreading used in programming?
Multithreading Programming
Multithreading programming is a technique where a single program is divided into multiple threads that can run at the same time. Each thread represents a small unit of execution, allowing the program to perform multiple tasks concurrently within the same process.
Why Multithreading is Used
Multithreading is used to improve the performance and responsiveness of applications. It allows better utilization of CPU resources, enables tasks to run in parallel on multi-core processors, and helps keep programs responsive while performing time-consuming operations such as file processing or network communication.
Multithreading Programming
Multithreading programming হলো এমন একটি technique যেখানে একটি program-এর ভিতরে একাধিক thread তৈরি করা হয়। প্রতিটি thread একটি ছোট execution unit হিসেবে কাজ করে এবং একই process-এর মধ্যে একসাথে একাধিক কাজ করতে পারে। এর ফলে program একই সময়ে বিভিন্ন task handle করতে সক্ষম হয়।
Multithreading কেন ব্যবহার করা হয়
Multithreading ব্যবহার করা হয় মূলত program-এর performance এবং responsiveness বাড়ানোর জন্য। এটি CPU-এর ভালো utilization নিশ্চিত করে, বিশেষ করে multi-core processor-এ parallel execution সম্ভব করে। এছাড়াও, time-consuming কাজ যেমন file processing বা network operation চলাকালীন program-কে responsive রাখতেও multithreading খুব কার্যকর।
- 7Database Management SystemRelationDiscuss about different types of relations in DBMS.
In Database Management Systems (DBMS), relationships define how data in different tables are connected. There are three main types of relationships in a relational database:
1. One-to-One (1:1) Relationship:
Each record in Table A is linked to only one record in Table B, and vice versa.Example:
- A person and their passport (One person has only one passport, and one passport belongs to one person).

2. One-to-Many (1:M) Relationship:
A record in Table A can be linked to multiple records in Table B, but each record in Table B is linked to only one record in Table A.Example:
- A customer can place multiple orders, but each order belongs to only one customer.

3. Many-to-Many (M:N) Relationship:
Each record in Table A can be linked to multiple records in Table B, and vice versa.Example:
- A doctor can treat multiple patients, and a patient can have multiple doctors.

Database Management System (DBMS)-এ relationship ব্যবহার করা হয় বিভিন্ন table-এর মধ্যে data কীভাবে একে অপরের সাথে সংযুক্ত তা বোঝানোর জন্য। Relational database-এ প্রধানত তিন ধরনের relationship রয়েছে:
১. One-to-One (1:1) Relationship:
এই relationship-এ Table A-এর একটি record শুধুমাত্র Table B-এর একটি record-এর সাথে যুক্ত থাকে, এবং Table B-এর একটি record-ও শুধুমাত্র Table A-এর একটি record-এর সাথে যুক্ত থাকে।উদাহরণ:
- একজন ব্যক্তি এবং তার passport (একজন ব্যক্তির একটি passport থাকে এবং একটি passport শুধুমাত্র একজন ব্যক্তিরই হয়)।

২. One-to-Many (1:M) Relationship:
এই relationship-এ Table A-এর একটি record Table B-এর একাধিক record-এর সাথে যুক্ত হতে পারে, কিন্তু Table B-এর প্রতিটি record শুধুমাত্র Table A-এর একটি record-এর সাথেই যুক্ত থাকে।উদাহরণ:
- একজন customer একাধিক order দিতে পারে, কিন্তু প্রতিটি order শুধুমাত্র একটি customer-এরই হয়।

৩. Many-to-Many (M:N) Relationship:
এই relationship-এ Table A-এর একটি record Table B-এর একাধিক record-এর সাথে যুক্ত হতে পারে, এবং Table B-এর একটি record-ও Table A-এর একাধিক record-এর সাথে যুক্ত থাকতে পারে।উদাহরণ:
- একজন doctor একাধিক patient-এর চিকিৎসা করতে পারে, এবং একজন patient একাধিক doctor-এর চিকিৎসা নিতে পারে।

- 8Data StructureQueueDifference between Stack and Queue. Write about 2 problems solved by Stack and Queue.
Order: Stack follows LIFO (Last In First Out); Queue follows FIFO (First In First Out).
Insertion: In Stack, insertion is called push; in Queue, it is called enqueue.
Deletion: In Stack, deletion is called pop; in Queue, it is called dequeue.
Access: Stack allows access to the top element only; Queue allows access from front and rear.
Structure: Stack works like a vertical pile; Queue works like a line (queue).
Example: Stack → plates stack; Queue → people standing in a line.
Problems Solved by Stack:
- Balancing Parentheses (Expression Validation)
- Backtracking (Undo Operation)
Problems Solved by Queue:
- Task Scheduling (CPU Scheduling)
- BFS (Breadth-First Search) in Graphs
Order: Stack LIFO (Last In First Out) অনুসরণ করে; Queue FIFO (First In First Out) অনুসরণ করে।
Insertion: Stack-এ insertion কে push বলে; Queue-এ enqueue বলে।
Deletion: Stack-এ deletion কে pop বলে; Queue-এ dequeue বলে।
Access: Stack-এ শুধুমাত্র top element access করা যায়; Queue-এ front ও rear থেকে access করা যায়।
Structure: Stack একটি pile এর মতো; Queue একটি লাইন এর মতো কাজ করে।
Example: Stack → থালা স্তূপ; Queue → লাইনে দাঁড়ানো মানুষ।
Problems Solved by Stack:
- Balancing Parentheses (Expression Validation)
- Backtracking (Undo Operation)
Problems Solved by Queue:
- Task Scheduling (CPU Scheduling)
- BFS (Breadth-First Search) in Graphs
- 9Non Technical QuestionNon tech
- Which you build about real-life software project? What problems you faced during that time and how to solve this?
- Database query:
- (i) Group by
- (ii) Average Salary
- Write a short composition “The Role of computer on education system in Bangladesh”.
- Write a letter to your younger brother about the Importance of professional vocational training.
- Math: Interest related
- Math: Set related (72%, 40%, and both 30%)
- Math: Gold purity
- Math: Geometry
- Translation English to Bangla
- Translation Bangla to English




