What is the difference between Function and Procedure? - ProProfs Discuss
Advertisement

What is the difference between Function and Procedure?

Asked by R. Barnes, Last updated: Apr 05, 2024

+ Answer
Request
Question menu
Vote up Vote down

1 Answer

H.Harper

H.Harper

H.Harper
H.Harper

Answered Mar 02, 2020

A major difference between function and procedure is that a procedure does not return a value, while function can return a value. The procedure does well to execute a command or carry out a function, while on the other hand, function usually has a return statement in it. A function is also called as a segment of an expression. Using the calculation of the area of a circle as an example, when you as a user call for the function, it will pass the data, which is the area of a circle that you inputted and will return the area of the circle also to you.

On the other hand, in the procedure, you can pass the radius of a circle to it, it will not return any data to you, but will input the radius into a table. A function is a subroutine or named code block that is used exclusively by C-based languages, while the procedure is a named code block also, which is used by Basic-based languages, and pass-through parameters or accepts input and output.

upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.