In: Computer Science
What is an subprogram or subroutine and how is it defined?
What is a subprogram: Call? Header? Protocol? Signature?
What are formal and actual parameters for a subprogram?
How does a programming language match formal and actual parameters?
Answer 1:
subprogram or subroute is set of statement which is wrapped in a
block and has anem
syntax:
int sum(){
}
here we have defined the sum subprogram or subroutine
Answer 2:
Call: calling the defined subroutine. means we are using the
subroutine what we have defineed
Signature: It contains name of the subroutine,what parameters it
takes and its types and what it will return
Protocl: rules to follow to call the subroutine
Answer 3:
formatl arguments: These are defined at subprogram or
subroutine
actual arguments: These are passed from caller side
int sum(int x,int y)
{
return x+y;
}
a=10,b=20;
print(sum(a,b));
here x and y are formatl arguments and a,b are actual arguments
Answer 4:
programming language matches arguments using the order and type of
arguments
defined in subroutine
NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.
Please Like and Support me as it helps me a lot