Programming: Functions Vs Procedures

What is the difference between Functions and Procedures in programming languages?

to understand the difference between functions and procedures we first have to have a look at what are functions and what are procedures.

functions are the part of today's programming languages in which when we want to use same code again and again, we simply put it into function, then we simply have to call that function whenever we want to use it. Like once we manufactured a printer then whenever want to use to we don't need to manufactured it again we simply use, same concept is for functions, let's we build a simple function which will generate a cube of the given number in C Language, you can use the same concept in other languages like Java, C#, Python, Javascript, PHP and many other languages.

int getcube(int val)

return val*val*val;


when you call the above getcube() function you will have to put a number whose cube you want, so let's give it some numbers and see what will it return.





Programming: Functions Vs Procedures Programming: Functions Vs Procedures Reviewed by Admin CZ on 1:31:00 PM Rating: 5

No comments