BGDCL Sub-Assistant Engineer Exam 19 November 2021 — Question Solution | বাখরাবাদ গ্যাস (বিজিডিসিএল) উপ-সহকারী প্রকৌশলী নিয়োগ পরীক্ষা ২০২১ — প্রশ্ন সমাধান
Page updated
ARBS Academy · itjobs.arbsacademy.com
About this exam paper · প্রশ্নপত্র পরিচিতি
The BGDCL Sub-Assistant Engineer exam was held on 19 November 2021, conducted by BUET. The paper had 3 written questions. The subjects asked most were Networking (2) and Programming (1). This page lists every question, with 1 answered and explained; the rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
বাখরাবাদ গ্যাস (বিজিডিসিএল) উপ-সহকারী প্রকৌশলী নিয়োগ পরীক্ষার (২০২১) এই প্রশ্নপত্রে ৩টি প্রশ্ন ছিল, বেশিরভাগ নেটওয়ার্কিং ও প্রোগ্রামিং থেকে। এখানে ১টি প্রশ্নের ব্যাখ্যাসহ উত্তর দেওয়া আছে; বাকিগুলো ফ্রি অ্যাকাউন্টে খোলে।
- Organisation
- BGDCL
- Post
- Sub-Assistant Engineer
- Exam date
- 19 November 2021
- Conducted by
- BUET
- Questions
- 3 (0 MCQ, 3 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
১. ক) Serial ও Parallel Transmission এর মধ্যে পার্থক্য লিখ।
১. খ) 8-bit এর Serial ও Parallel Transmission এর diagram আঁক।
Sign up free to see the model answers to written questions 1–2 · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
২. N সংখ্যাটি Prime number কিনা যাচাই করার জন্য একটি Program (any language) লিখ।
Model answer
মৌলিক সংখ্যা (Prime number): ১-এর চেয়ে বড় যে পূর্ণসংখ্যার ১ ও সে নিজে ছাড়া আর কোনো ধনাত্মক উৎপাদক নেই। ০, ১ ও ঋণাত্মক সংখ্যা মৌলিক নয়।
পদ্ধতি: N যৌগিক হলে N = a × b (a ≤ b) লেখা যায়, তখন a ≤ √N। তাই 2 থেকে √N পর্যন্ত কোনো সংখ্যা দিয়ে N বিভাজ্য না হলে N মৌলিক। প্রথম উৎপাদক পেলেই লুপ থামানো হয়।
অ্যালগরিদম
- N ইনপুট নাও।
- N < 2 হলে "Prime নয়"।
- i = 2 থেকে i × i ≤ N পর্যন্ত: N % i = 0 হলে "Prime নয়", থামো।
- কোনো উৎপাদক না পেলে "Prime"।
প্রোগ্রাম (C)
#include <stdio.h>
int main(void)
{
int n, i, isPrime = 1;
printf("Enter N: ");
if (scanf("%d", &n) != 1) {
printf("Invalid input\n");
return 1;
}
if (n < 2)
isPrime = 0; /* 0, 1 ও ঋণাত্মক সংখ্যা মৌলিক নয় */
else
for (i = 2; i <= n / i; i++) /* i*i <= n, overflow ছাড়া */
if (n % i == 0) {
isPrime = 0; /* উৎপাদক পাওয়া গেছে */
break;
}
if (isPrime)
printf("%d is a Prime number\n", n);
else
printf("%d is not a Prime number\n", n);
return 0;
}
নমুনা আউটপুট
Enter N: 17
17 is a Prime number
Enter N: 91
91 is not a Prime number
Enter N: 1
1 is not a Prime number
Enter N: 2
2 is a Prime number
Trace (N = 91): i = 2 → 91 % 2 = 1; i = 3 → 1; i = 4 → 3; i = 5 → 1; i = 6 → 1; i = 7 → 91 % 7 = 0, তাই isPrime = 0 এবং লুপ থামে (91 = 7 × 13)।
Trace (N = 17): i = 2, 3, 4-এ ভাগশেষ শূন্য নয়; i = 5-এ 5 > 17/5 = 3, লুপ শেষ; কোনো উৎপাদক নেই, তাই 17 মৌলিক।
কেন i <= n / i: এটি i × i ≤ n-এর সমান, কিন্তু N যখন 2147483647-এর কাছাকাছি, তখন i * i int overflow ঘটাতে পারে; n / i-তে সে ঝুঁকি নেই।
| লুপের সীমা | N মৌলিক হলে সর্বোচ্চ ভাগ | সময় জটিলতা |
|---|---|---|
| 2 থেকে N − 1 | N − 2 বার | O(N) |
| 2 থেকে N/2 | প্রায় N/2 বার | O(N) |
| 2 থেকে √N | প্রায় √N বার | O(√N) |
পরীক্ষার টিপ: N < 2-কে আগে আলাদা করুন (১ মৌলিক নয়), √N পর্যন্ত ভাগ পরীক্ষা করুন এবং প্রথম উৎপাদক পেলেই break দিন।
Explanations © ARBS Academy
Questions about this paper · সাধারণ প্রশ্ন
- How many questions were in the BGDCL Sub-Assistant Engineer exam (2021)?
- 3 written questions.
- Which subjects were asked most in the BGDCL Sub-Assistant Engineer exam (2021)?
- Networking (2) and Programming (1), out of 3 questions.
- When was the BGDCL Sub-Assistant Engineer exam held?
- On 19 November 2021, conducted by BUET.
- Where can I find the BGDCL Sub-Assistant Engineer exam (2021) question solution?
- On this page: 1 of the 3 questions are shown with worked answers. The rest of the answers open with a free ARBS Academy account, where the paper can also be practised as a timed test.
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers