answersLogoWhite

0


Best Answer

In closed subroutine a subroutine stored outside the main routine can be connected to it by linkages at one or more locations.

whereas in open subroutine is a set of computer instructions i.e. a subroutine that performs some particular program and insert them directly each and every time that particular function is required

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

Nothing. Functions and subroutines are the same thing, as are procedures. Although we often think of a function as being a procedure or subroutine that returns a value, not all functions return a value; some functions are purely functional.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

A function is a section of code that takes no or more parameters and returns a result. Generally, a well behaved function has no side-effects. An example is sin(x). A subroutine is a section of code that takes no or more parameters and returns no result. It can also have side-effects, such as modifying the value of one of the parameters, assuming call-by-reference semantics. An example is fclose(file). Differences depend on the language, such as C/C++ vs FORTRAN. The "no side-effect" rule is not hard and fast. You can write functions or subroutines that make changes, such as to open a file, read it, close it, etc. Generally, concern about side-effects relate to optimization or to modular design. One big area of concern for the "non side-effect" rule is thread-safeness, where you need to know if the routine affects things on a global basis. It comes down to what you want to do, and how the language you are using supports that need.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Sub routines are used inside programs, sort of like a g70 or g71 as you state a start block and end block and the computer follows the path. A sub program is a secondary program called up by the main program that works well for repetitive tool paths.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

A function returns a value whereas a subroutine does not. A function should not change the values of actual arguments whereas a subroutine could change them.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

A function returns a value, a subroutine does not.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Usually a function is considered a type of procedure (which also includes things like subroutines and methods), though it seems like this definition isn't concrete.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How does a function differ from a procedure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What statements indicate the start and end of a procedure?

A procedure is started by calling the function that represents that procedure. The function call must include any and all required arguments.The procedure ends whenever a return statement is encountered anywhere within the function body, or execution falls off the end of the function (assuming no return value is expected from the procedure), or a non-return function is invoked by the function (such as the abort() function) or an unhandled exception is thrown by the function. Apart from a non-returning function call, execution always returns to the calling code (the caller). If an unhandled exception is thrown by a function, the call stack automatically "unwinds" until a suitable exception handler is found. If no handler is found on the call stack, the global main function will unwind, terminating the program with an unhandled exception error. Hence the reason all non-trivial programs should provide a "catch-all" exception handler in the global main function.


What is the purpose of a function or procedure?

function is a set of statements that can be executed in the part of the program. ex: to add two nos. using function void main() { int a,b,c; printf("enter the two numbers"); scanf("%d%d",&a,&b); add(a,b); clear(); } void add(int a,int b) { c=a+b; printf("the sum is %d",c); }


Can a C plus plus user defined function return a value?

Absolutely. Indeed, any function (user-defined or built-in) that does not return a value is not really a function, it is simply a procedure.


Differentitate between overload function and function template?

An overloaded function is a function that has two or more implementations that each operate upon a different type. Function templates allow the compiler to generate overloaded functions on an as required basis for any function where the implementations only differ by type.


When a function does not return a value what kind of function is it called?

In most computer languages, a procedure that returns a value is called a function and a procedure that does not return a value is called a subroutine or subprogram. Usually the languages treat the passing of arguments/parameters differently between functions and subroutines. The C language does not distinguish between them. A subroutine that does not return a value is define as a "void" function indicating that no return value is used or available.

Related questions

How does the procedure for a case heard in an appeals court differ from the procedure in a trial court?

No the procedure for a cease heard in an Appeal's court does not differ much from the procedure in a trial court.


How can a procedure be defined in C plus plus?

A procedure is simply a function in C++, therefore you define procedures just as you would any function. In some languages, a procedure is not a function as such, insofar as there is no return type. The C++ equivalent would therefore be a function that returns void.


Does the function of nucleic acids differ from plants to animals?

No! They have similar function


What is the difference between a function and Procedure?

Girraf


Procedure to replace kidney function'?

dialysis


Why is the counter stain for gram stain procedure differ from the counter stain used for acid fast procedure?

Safranin


How is a procedure identified as near or far?

The far procedure is used at the place where the function call is given in main program and function definition is given in sub program....


What do you call a variable of a function that is active only within the procedure or its function?

local variable


Another name for method?

* Function * Subroutine * Procedure


What is the procedure to replace the kidney function?

It is called dialysis.


How do dandelion roots differ from roots of grass?

the dandelion roots differ from roots of grass by different function


What is a function procedure in Visual Basic?

A function is essentially a subroutine that is ment to be used by other subroutines.