why c is called as the top down approach?
C programming uses top down approach to solve a problem.
Top down approach starts with high-level design and ends with the low-level implementation.
In top down approach, we use following approach to solve any problem.
1.First we will make a high level design of a problem statement.
2.After that we will write the main function.
3.From the main function we will call the sub functions.
Generally, the large program is divided into small small sub functions(each function will do a specific task) which improves the modularity of a program.
Using that we can easily debug the program.
4.Later we will implement(code) all the sub functions based on requirements. Thats why c is called the top down approach.
Write a c program to implement a simple calculator.
declare two integers
scan the values from the user
addition, subtraction, multiplication, division are sub functions.