Difference between Parameters and Arguments

A PARAMETER is an entry in a function header. A function’s parameters are fixed; they do not change during program execution.

 

An ARGUMENT is an actual value passed to the function by calling the program. Each time a function(half_of()) is called, it can be passed with different arguments.

#include<stdio.h>

#include<conio.h>

float x=3.5,y=65.11,z;

float half_of(float kk);

void main()

{

/*In this call, x is the argument to half_of()*/

z=half_of(x);

printf("the value of z=%f\n",z);

/*In this call, y is the argument to half_of()*/

z=half_of(y);

printf("the value of z=%f\n",z);

getch();

}

float half_of(float kk)

{

/*kk is the parameter. Each time half_of() is called*/

/*kk has the value that was passed as an argument*/

return(kk/2);

}

Output..

difference between argument and parameter