Computer Science, asked by Anonymous, 8 months ago

Q4 a) Which among the following list of operators has the highest precedence ?
+,-, **%, l, «, »,
(b) What is the difference between the formal parameters and actual parameters? What is their a
name? Also give a suitable Python code to illustrate both​

Answers

Answered by Itzabhi001
3

Explanation:

the difference between the formal parameters and actual parameters? What is their a

name? Also give a suitable Python code to illustrate both.

Answered by dreamrob
3

Operator Precedence :

** : highest

%

+ , -

<< , >>

| : lowest

So, among the given list of operators ** (exponent) has the highest precedence.

Formal Parameters :

  1. The parameters / arguments in the function definition.
  2. Data types needs to be mentioned.
  3. It is specified when function is defined.
  4. They are in the called function.

Example :

int square (int a)

{

  int s;

  s = a*a;

  return(s);

}

a is formal parameter.

Actual Parameters :

  1. The arguments are passed in a function call.
  2. Data type is not required but it should match with the corresponding data type of the formal parameters.
  3. Parameters which are specified when a Functions or Procedures is called.
  4. They passed by the calling function.

Example :

void main()

{

  int a;

  a = square(5); //function call

}

5 is an actual parameter.

Similar questions