C Programmin1
C Programmin1
Unit-1
Programming Paradigms
Procedural Programming
In procedural programming, the user is encouraged to subdivide the program
execution into functions, as a way of improving modularity and organization.
function pourIngredients() {
- Pour flour in a bowl
- Pour a couple eggs in the same bowl
- Pour some milk in the same bowl
}
function mixAndTransferToMold() {
- Mix the ingredients
- Pour the mix in a mold
}
function cookAndLetChill() {
- Cook for 35 minutes
- Let chill
}
pourIngredients()
mixAndTransferToMold()
cookAndLetChill()
Object-oriented Programming
Eg: C++,java,Python
Procedural Programming
The paradigm deals with procedure calls that are called routines or
functions. the functions contain a series of computational commxcands to be
carried out to achieve a certain outcome.
The parallel programming paradigm breaks the problem or task into chunks that
are distributed among multiple processors. These chunks work on the same
problem, simultaneously. It reduces the total time to solve a problem. It connects
multiple processors to the memory. It is either pooled across all processors or
distributed over a network. Eg:VHDL,Verilog
Logical Programming