C – Pass by Value

Home/C - Tutorial/C - Functions/C – Pass by Value
C – Pass by Value 2017-07-19T23:58:31+00:00

Pass by value :

Arguments can be passed to a function by two methods, They are

  1. pass by value
  2. pass by reference

Function in C passes all arguments by value. When a single value is passed to a function via an actual argument, the value of the actual argument is copied into the function. Therefore, the value of the corresponding formal argument can be altered within the function, but the value of the actual argument within the calling routine will not change. This procedure for passing the value of an argument to a function is known as passing by value.

C – PASS BY VALUE EXAMPLE :

Output :

Enter two numbers

10

20

Sum of 10 and 20 is 30

Prev Next