C C++ Java Data Structure Python JavaScript CSS Ajax PL/SQL PHP Puzzles C programs C++ programs Java programs

Home » C++ programming language

Top-down and bottom-up approach in C/C++ programming

Learn: What is top-down and bottom-up approach in programming languages? In this article we are going to learn programming approach with their advantages.

1) Top-down approach

In this approach, a large project divides into small programs, and these programs are known as modules.

C programming language supports this approach for developing projects. It is always good idea that decomposing solution into modules in a hierarchal manner.

The basic task of a top-down approach is to divide the problem into tasks and then divide tasks into smaller sub-tasks and so on.

In this approach, first we develop the main module and then the next level modules are developed. This procedure is continued until all the modules are developed.

Advantages of top-down approach:

  1. In this approach, first, we develop and test most important module.
  2. This approach is easy to see the progress of the project by developer or customer.
  3. Using this approach, we can utilize computer resources in a proper manner according to the project.
  4. Testing and debugging is easier and efficient.
  5. In this approach, project implementation is smoother and shorter.
  6. This approach is good for detecting and correcting time delays.
top to down approach

2) Bottom-up approach

C++ used the bottom-up approach for project development. It is an alternative approach to the top-down approach.

In this approach, bottom level modules developed first (Lower level module developed, tested and debugged). Then the next module developed, tested and debugged. This process is continued until all modules have been completed.

This approach is exactly opposite to the top-down approach. This approach is good for reusability of code.

bottom to up approach

Imager source: The Bottom-Up Approach - Wikipedia