answersLogoWhite

0


Best Answer

Nothing special, try it:

void foo (int frec, int val)

{

. int x= val;

. if (frec) {

. . printf ("before recursion x=%d\n", x);

. . foo (frec-1, val+1);

. . printf ("after recursion x=%d\n", x);

. } else {

. . printf ("in recursion x=%d\n", x);

. }

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: When a function is recursively called all automatic variables are stored in a list stored in a stack stored in an array stored in queue?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Which variable is not destroyed on exit from the function instead its value is presented and becomes available again when the function is next called These variables are declared as?

Local function variables defined static remain in memory at all times. Such variables are only in scope (accessible) when the function itself is in scope.


Explain the allocation of memory cells when a function is called?

When you call a function, the stack pointer is adjusted to cater for the function's arguments (if any), the caller's return address (mandatory), the function's local variables (if any) and the function's exception handlers (if any).


What is the simularities of parameter and arguments?

Arguments are fields that are given to a method when it is called, while parameters are the name for the received variables. For example:public static void main(String[] args){int arg1 = 0;boolean arg2 = false;String arg3 = "Some string";function_a(arg1, arg2, arg3);// These variables are called arguments because they are being passed// to the function.}public static void function_a(int par1, boolean par2, String par3){// These variables are called parameters because they are being received// when the function is called.}I hope this helps.


How do you declare local and global variables in pseudo code?

Pseudocode is not a programming language (it's specifically intended for human interpretation), so there is no need to declare variables, you simply define them as and when you require them. For instance: Let x = 42 Let y = x * 2


What are local variables and global variables?

Local variables: These variables only exist inside the specific function that creates them. They are unknown to other functions and to the main program. As such, they are normally implemented using a stack. Local variables cease to exist once the function that created them is completed. They are recreated each time a function is executed or called. Global variables: These variables can be accessed (ie known) by any function comprising the program. They are implemented by associating memory locations with variable names. They do not get recreated if the function is recalled.

Related questions

What are the input values of a function called?

variables


What actually happens when function get called how the compiler is reading the next instruction after completing that function?

When a function gets called, the processor first stores the address of the calling function in a structure called activisation structure and jumps to the called function. Then it allocates the memory for the local variables and initializes them. Then it does the processing in that function. After that it deallocates the memory allocated for the local variables and returns to the calling function. When a function gets called, the processor first stores the address of the calling function in a structure called activisation structure and jumps to the called function. Then it allocates the memory for the local variables and initializes them. Then it does the processing in that function. After that it deallocates the memory allocated for the local variables and returns to the calling function.


Which variable is not destroyed on exit from the function instead its value is presented and becomes available again when the function is next called These variables are declared as?

Local function variables defined static remain in memory at all times. Such variables are only in scope (accessible) when the function itself is in scope.


What is a summary of linear programming?

It is a process by which a linear function of several variables, called the objective function, is maximised or minimised when it is subject to one or more linear constraints in the same variables.


What actions are performed when function is called?

In the context of a macro or program, the values of the arguments of the function (variables) are substituted into the function and it is evaluated. The result is returned.


What is the name of a sentence that defines the value of the unknowns in a problem is called a?

A sentence which defines a value of variables in a mathematical problem is called a statement. The relationship between variables in a mathematical problem is called a function.


What is non recursion called?

Iteration. A problem not solved recursively is solved iteratively.


What are the overheads in using recursion?

Variables that are passed to the function but your teacher wants to know where those variables are stored and why it can be a problem. It is your job to find out, its called learning.


What is an algebraic equation called that shows relationship among several variables that starts with a f?

a function!


How do you define function in php?

A function is defined in php by placing the keyword function before the chosen function name.The function name must not match a pre-defined function and has certain limitation as to the characters that can be part of it. Notably, the function name must not contain any spaces. Following the function name are a parenthesis-enclosed, comma-separated list of variables, these variables are called calling parameters and are helpful if the function must process some values or follows diferent branches depending on external variables. Finally the function body is enclosed in curly brackets { }.


Why are function notation important?

A function is a relationship between quantities (variables) that occurs when the value of one of the quantities can be given uniquely by specified values of the other quantities. The variables involved can be either independent or dependent. The values of certain variables are fixed while others are allowed to change. The fixed variables are called the independent variables, and the dependent variables are those that change in response to the given value of the independent variable. A function therefore relates dependent variables to independent variables, the only restriction being that each value of the dependent variable is given uniquely by one, and only one, value for each of the independent variables.


What are the values that are used in a function?

There are several possibilities. They can be called arguments and there are two kinds, variables and constants. Variables can have different values and constants are always the same.