answersLogoWhite

0


Best Answer

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);

}

User Avatar

Wiki User

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

Wiki User

11y ago

A Function procedure is a series of Visual Basic statements enclosed by the Function and End Functionstatements. The Function procedure performs a task and then returns control to the calling code. When it returns control, it also returns a value to the calling code.

Each time the procedure is called, its statements run, starting with the first executable statement after the Functionstatement and ending with the first End Function, Exit Function, or Return statement encountered.

You can define a Function procedure in a module, class, or structure. It is Public by default, which means you can call it from anywhere in your application that has access to the module, class, or structure in which you defined it.

A Function procedure can take arguments, such as constants, variables, or expressions, which are passed to it by the calling code.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the purpose of a function or procedure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the purpose of balloon valvuloplasty?

The goal of the procedure is to improve valve function and blood flow by enlarging the valve opening. It is sometimes used to avoid or delay open heart surgery and valve replacement.


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.


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.


What is the purpose of the keyword void in a function declaration?

when we declare any function with void,it doesnt return any value


What is the purpose of the program stack?

Its main use is to store local variables, arguments and return address each time a function is called.When your program calls a function the following happen :- The function arguments are put on the stack- The current instruction pointer is put on the stack- The program jumps to the start of the function- Space is allocated on the stack to hold local variables- The function executes- The space holding local variables is de-allocated- The instruction pointer is restored and removed from the stack (we are now leaving the function and resuming the calling procedure)- The arguments are removed from the stack

Related questions

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.


What is the purpose of the procedure?

The purpose of Parliamentary Procedure is to keep a meeting running smoothly and to make sure everyone has a fair say in what is proposed to do.


What is the basic purpose and function of an independent laboratory?

basic purpose and function of an independent laboratory


The purpose and function of standard error of measurement?

the purpose and function of standard error of mean


Procedure to replace kidney function'?

dialysis


What is the difference between a function and Procedure?

Girraf


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


What is the purpose of balloon valvuloplasty?

The goal of the procedure is to improve valve function and blood flow by enlarging the valve opening. It is sometimes used to avoid or delay open heart surgery and valve replacement.


Another name for method?

* Function * Subroutine * Procedure


What is the procedure to replace the kidney function?

It is called dialysis.


What is the purpose of a function generator?

A function generator creates electrical waveforms. The purpose is for developing and testing electric equipment.