answersLogoWhite

0


Best Answer

A formal perimeter refers to an identifier that is used in a method to stand for the value that is passed into the method by a caller. An actual perimeter on the other hand refers to the actual value that is passed into the method by a caller.

User Avatar

Wiki User

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

Wiki User

9y ago

The "formal parameter" refers to the variable name you use in the function definition, the "actual parameter" is the actual value you pass in a particular case. If your function is defined something like:

MyFunction(x)

{

...

}

And you invoke it with:

MyFunction(10)

or:

MyFunction(a)

Then the variable "x" is the formal parameter; the value 10 or a is the actual parameter.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

While passing variable in a function the parameters featuring the calling functions are actual parameters while those featuring in the called function are formal parameters.

eg

void somefunc(int formal)

{

cout<<formal;

}

int main()

{

int actual;

somefunc(actual);

}

Here variable formal is formal parameter and actual is actual parameter

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Formal parameters are those that appear in a function's prototype, using the parameter names provided by the function implementation (which may differ from the names used in the function prototype), and that are subsequently used in the function body.

Actual parameters are those parameters that are passed by the calling function.

Actual parameters are evaluated and passed to the function via its formal arguments.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

formal parameter is we accept in function body/defination

actual parameter is we pass from calling function to function body.

Ex :

int a,b;

void add (a,b) ; where a & b is actual parameter // calling function

void add(int i,int j) where i & j are formal parameter // function body

{

}

By Darshan Paliwal

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

An actual parameter is a value supplied to a method or function in programming.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is an actual parameter?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

In python are actual and formal parameters matched up by position or name?

When we invoke a function, we pass the actual arguments in the same order specified by the function's formal arguments, thus it is the relative position that determines how they are matched. Note that actual parameter names are within the scope of the calling code while formal parameter names are scoped to the function in which they are declared. The calling code has no access to the formal argument names, and the function may or may not have access to the actual argument names. Python uses the pass-by-object paradigm: if the object being passed is immutable, then it is passed by value (the formal parameter is assigned a copy of the object's value), otherwise it is passed by reference (in which case the formal argument becomes an alternative name for the actual argument).


What is difference between parameter and argument in java?

They are synonyms.Some people use the word 'argument' for the 'formal parameter' and 'parameter' for the 'actual parameter', others do on the other way around.PS:example for the formal parameters (function declaration):int myfun (const char *s, int p);example for the actual parameters (function calling):myfun ("Hello", 44);


Explain the difference between an argument and a parameter Use a C plus plus program segment to illustrate your answer?

In C++ there is no such thing as a parameter, there are only arguments, both actual and formal. Some languages use the term parameter to mean a formal argument and argument to mean an actual argument, while others reverse the meanings completely. Some languages make no distinction at all and use the terms parameter and argument interchangeably. However, C++ is quite clear on this: actual arguments are the names that you pass to a function, while formal arguments are the names received by the function. Even so, you will still encounter incorrect usage of the terms parameter and arguments, even by C++ experts (myself included!) The following example code demonstrates the difference between an actual argument and a formal argument, as the terms apply in C++: int foo(int formal) { return(formal*2); } void bar(int&amp; formal) { formal*=2; } int main() { int actual=1; actual = foo(actual); bar(actual); return(0); } The function foo() declares a formal argument by value while bar() declares a formal argument by reference. In main() we declare a variable with the name actual and pass this actual argument to both functions in turn. When we pass actual to foo(), the value of actual is assigned to formal. Since formal is a copy of actual, they are separate names with separate values (initially they will have the same value of course). Thus any changes made to formal will have no effect on actual, hence we must assign the return value from foo() to actual in main(), in order to record the change made by foo(). When we pass actual to bar(), a reference to actual is assigned to formal. A reference is simply an alternate name for the same argument, however the name actual is not visible to bar(), so they are still separate names, but they always have the same value. Thus any changes to formal will affect actual, thus there is no need to assign any return value to record the change.


What is the r-parameters of transistor?

r parameter is resistance parameter


What is the desired target value for a parameter?

The target value of a parameter is the perimeter.

Related questions

A parameter that is passed to a module in a particular call is known as a an?

actual parameter


What is parameter is parameter is?

formal parameter is we accept in function body/defination actual parameter is we pass from calling function to function body. Ex : int a,b; void add (a,b) ; where a &amp; b is actual parameter // calling function void add(int i,int j) where i &amp; j are formal parameter // function body { } By Darshan Paliwal


Is A query that prompts for input whenever it is run is a run-time query?

It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.It is referred to as a parameter query.


What are the examples of instrumental error?

If an instrument is indicating a wrong parameter instead of actual. Say the actual pressure is 1 bar but the instrument is reading 1.5 bar is an example of instrumental error.


What is the parameter of the Earth?

what is the parameter of earth


Why and when should programmers use a constant reference parameter?

when we use that parameter as a global parameter and we used that parameter through out the program without changing


In python are actual and formal parameters matched up by position or name?

When we invoke a function, we pass the actual arguments in the same order specified by the function's formal arguments, thus it is the relative position that determines how they are matched. Note that actual parameter names are within the scope of the calling code while formal parameter names are scoped to the function in which they are declared. The calling code has no access to the formal argument names, and the function may or may not have access to the actual argument names. Python uses the pass-by-object paradigm: if the object being passed is immutable, then it is passed by value (the formal parameter is assigned a copy of the object's value), otherwise it is passed by reference (in which case the formal argument becomes an alternative name for the actual argument).


What does parameter mean in science?

A parameter is something that limits something else. A parameter is a limit, or a boundary.


What is difference between parameter and argument in java?

They are synonyms.Some people use the word 'argument' for the 'formal parameter' and 'parameter' for the 'actual parameter', others do on the other way around.PS:example for the formal parameters (function declaration):int myfun (const char *s, int p);example for the actual parameters (function calling):myfun ("Hello", 44);


What is a parameter in maths?

A parameter is like a limit or a specification.


Explain the difference between an argument and a parameter Use a C plus plus program segment to illustrate your answer?

In C++ there is no such thing as a parameter, there are only arguments, both actual and formal. Some languages use the term parameter to mean a formal argument and argument to mean an actual argument, while others reverse the meanings completely. Some languages make no distinction at all and use the terms parameter and argument interchangeably. However, C++ is quite clear on this: actual arguments are the names that you pass to a function, while formal arguments are the names received by the function. Even so, you will still encounter incorrect usage of the terms parameter and arguments, even by C++ experts (myself included!) The following example code demonstrates the difference between an actual argument and a formal argument, as the terms apply in C++: int foo(int formal) { return(formal*2); } void bar(int&amp; formal) { formal*=2; } int main() { int actual=1; actual = foo(actual); bar(actual); return(0); } The function foo() declares a formal argument by value while bar() declares a formal argument by reference. In main() we declare a variable with the name actual and pass this actual argument to both functions in turn. When we pass actual to foo(), the value of actual is assigned to formal. Since formal is a copy of actual, they are separate names with separate values (initially they will have the same value of course). Thus any changes made to formal will have no effect on actual, hence we must assign the return value from foo() to actual in main(), in order to record the change made by foo(). When we pass actual to bar(), a reference to actual is assigned to formal. A reference is simply an alternate name for the same argument, however the name actual is not visible to bar(), so they are still separate names, but they always have the same value. Thus any changes to formal will affect actual, thus there is no need to assign any return value to record the change.


What is the r-parameters of transistor?

r parameter is resistance parameter