Lab 6
Lab 6
Signature: ____________________________
Objective
The objective of this lab is to observe the basic knowledge of programming in C++.
Equipment and Component
Component Value Quantity
Description
Computer Available in lab 1
Conduct of Lab
1. Students are required to perform this experiment individually.
2. In case the lab experiment is not understood, the students are advised to seek help from
the course instructor, lab engineers, assigned teaching assistants (TA) and lab
attendants.
Recursive functions are functions that call themselves, allowing problems to be solved by
breaking them down into smaller subproblems. They consist of a base case that defines when the
recursion should stop and a recursive case that calls the function with modified parameters. By
dividing complex problems into smaller subproblems, recursive functions provide an elegant and
efficient solution. Care must be taken to ensure the base case is reached to avoid infinite
recursion. Recursive functions are commonly used for tasks such as calculating factorials,
traversing data structures, and solving mathematical problems.
Lab Task
Part A [Marks: 5]
Pattern:
*****
*****
*****
*****
*****
Pattern:
*
**
***
****
*****