Basic and Advance Programming Question:
How many ways can an argument be passed to a subroutine in programming?
Answer:
An argument can be passed in two ways in a programming language. They are Pass by Value and Passing by Reference.
Passing by value: This method copies the value of an argument into the formal parameter of the subroutine.
Passing by reference: In this method, a reference to an argument (not the value of the argument) is passed to the parameter.
Passing by value: This method copies the value of an argument into the formal parameter of the subroutine.
Passing by reference: In this method, a reference to an argument (not the value of the argument) is passed to the parameter.
Previous Question | Next Question |
What is the difference between procedural and object-oriented programs? | What is difference between overloading and overriding in programming language? |