Programming Concepts · প্রোগ্রামিং ধারণা


Functions, Recursion and Scopeফাংশন, রিকার্সন এবং স্কোপ

Introduction

A function is the single most important tool for organizing a program. It lets you take a block of logic, give it a name, and reuse it as many times as you like — turning a long, repetitive program into a set of small, testable building blocks. Recursion is a special way of solving a problem where a function calls itself to solve a smaller version of the same problem. Scope is the set of rules that decide where in a program a given name (a variable or function) is visible and usable.

For BCS, Bank IT, and IT-officer exams these three ideas appear constantly: MCQs on the difference between parameters and arguments, tracing the output of a recursive factorial or Fibonacci, spotting the base case, counting how many times a function runs, call-by-value vs call-by-reference, the meaning of local vs global variables, and the role of the call stack. If you master this lesson you can answer almost any "what is the output" or "which of the following is true about functions" question.

Learning objectives

  • Define a function and explain why functions matter (modularity, reuse, abstraction).
  • Distinguish a parameter from an argument, and a function declaration from its definition and call.
  • Explain call by value vs call by reference and predict what each does to the caller's data.
  • Define recursion, identify the base case and recursive case, and trace a recursive call step by step.
  • Explain the call stack, stack frames, and stack overflow.
  • Convert simple recursion to iteration and know the trade-offs.
  • Define scope and lifetime, and distinguish local, global, static, and block scope.
  • Apply the correct terms in exam MCQs with confidence.

Continue this lesson free: create an account

You have read the opening of this lesson. The full lesson (2,964 words, in English and Bangla) has worked examples, practice questions with answers and exam tips. A free account opens it and saves your progress.পুরো পাঠটি পড়তে বিনামূল্যে অ্যাকাউন্ট খুলুন।

More on this subject: Programming guide: syllabus by chapter and past questions

© 2026 ARBS Academy (Aether Brains). Questions' explanations, model answers and lessons are our original work; copying or republishing is not allowed.

© ২০২৬ এআরবিএস একাডেমি (Aether Brains)। প্রশ্নের ব্যাখ্যা, মডেল উত্তর ও লেসন আমাদের নিজস্ব কাজ; কপি বা পুনঃপ্রকাশ করা নিষেধ।