answersLogoWhite

0


Best Answer

A function.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is an example of how a subroutine or procedure can be used several times in the same program each time accepting different values and passing them back?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How does a function differ from a procedure?

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


What are stacks subroutines in 8085 microprocessor?

A subroutine is a group of instructions that will be used repeatedly in diff locations of the program..........rather than repeating the same instructions several times, they can be grouped into a subroutine that is called from diff locations. 8085 has 2 instruction set for dealing with subroutines: 1.CALL -direct the program execution to the subroutine. Generally it pushes address of next instruction of program counter onto the stack,then goes to the address of subroutine. 2.RET:- pops the address of next instruction from the stack and places it in the program counter and returns to that address to continue processing. For example, you have an often used value stored in HL. You have to call a subroutine that you know will destroy HL (with destroy I mean that HL will be changed to another value, which you perhaps don't know). Instead of first saving HL in a memory location and then loading it back after the subroutine, you can push HL before calling and directly after the calling pop it back. Of course, it's often better to use the pushes and pops inside the subroutine.


Which is an example of a PLSQL subprogram?

A PL/SQL subprogram is equivalent to a procedure or function in conventional procedural programming.


What is implied by the argument of the function?

A function (also known as procedure, subroutine, and - in object-oriented languages - as a method) lets you do repetitive calculations in a single place, without having to repeat lots of commands over and over. For example, you might have a function that calculates the square root of a number. An argument (also known as a parameter) is any variable information you pass to your function. For example, in the case of calculating a square root, the argument tells the function what number you want to calculate the square root of. For calculating powers, you might have two arguments: the base, and the exponent. In general, a function can have zero or more arguments - it really depends what it is used for.


What statement causes a procedure to be executed in visual basic?

The basic code which responds to a specific event is called even procedure OR Event procedure is one which establishes the link between the object and code with the help of name OR Reaction og a control to the external condition

Related questions

What does procedural mean?

Procedure means actions that you record in order. procedure means how you did something in an exact order In computer terminology it can mean a set of programmed instructions that are performed repeatedly, such as a subroutine.


What are the example of procedure?

an example of a procedure that involves a inspection is


What are the examples of procedure?

an example of a procedure that involves a inspection is


What is delegate in net?

It is when you get the address of a subroutine so that you can use it...like pointers in C. For example: Private Delegate Sub Test() Sub bla() 'do nothing End sub Private the_delegate As Test = AddressOf bla 'to call the subroutine bla Sub Load() the_delegate.Invoke() End Sub


How does a function differ from a procedure?

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


Does one say accepting of or accepting to?

One should use "accepting of" to indicate someone's willingness to receive or approve of something. For example, "She was accepting of the new proposal."


What are stacks subroutines in 8085 microprocessor?

A subroutine is a group of instructions that will be used repeatedly in diff locations of the program..........rather than repeating the same instructions several times, they can be grouped into a subroutine that is called from diff locations. 8085 has 2 instruction set for dealing with subroutines: 1.CALL -direct the program execution to the subroutine. Generally it pushes address of next instruction of program counter onto the stack,then goes to the address of subroutine. 2.RET:- pops the address of next instruction from the stack and places it in the program counter and returns to that address to continue processing. For example, you have an often used value stored in HL. You have to call a subroutine that you know will destroy HL (with destroy I mean that HL will be changed to another value, which you perhaps don't know). Instead of first saving HL in a memory location and then loading it back after the subroutine, you can push HL before calling and directly after the calling pop it back. Of course, it's often better to use the pushes and pops inside the subroutine.


Why did Jesus need to get baptized?

He wanted to set an example for us to do after accepting him into our hearts


What are the example of courteous expression in accepting an invitation?

I am delighted to accept your gracious invitation.


Can you give me a sentence with nonspecific?

I'm having a bit of a problem accepting your nonspecific example.


What is the difference between a surgery and a procedure?

Any type of surgery is a procedure, a procedure for example can be a EKG, or a MRI, or a endoscopy. When you go into the hospital and whatever tests they perform is a procedure.


Difference between open subroutine and closed subroutine?

A closed subroutine is a normal unit like a function in C or a method in Java. When a closed subroutine is called, the program branches to the file/section of code, executes, and then returns to the line after the calling line.For example, if you had the following code in Java:main(...) {int a = 1;int b = 4;multiply(1,4);System.out.println("done!");}multiply(int a, int b) {int answer = 0;for(int i = 0; i < 4; i++)answer*=a;return answer;}Over here, the main method executes until it reaches multiply(1,4) and then jumps to the function (declared below main) and executes that. After it finishes executing multiple, it returns to the line after the function call, which in our case is System.out.println, and executes that.An open subroutine is a subroutine that adds the instruction to the already existing block of code. That is, it replaces the one line call with the entire set of instructions.For example, if you had the following code:startsave 1 in asave 4 in bmultiply a b-timesendThe command "multiply a b-times" is an open subroutine because the command will add lines at compile time to the existing code to return the following (this is best understood when thinking of the code as machine code):(translated from machine code)startsave 1 in asave 2 in bADDED CODEsave a * a in csave c * a in dsave d * a in ereturn eendAs you can see, the "multiply" command has been replaced with the entire set of instructions (under ADDED CODE).In short, an open subroutine adds lines to your main code while a closed subroutine is code stored in a separate block of code. Both subroutines are called with a single line of code.