home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list5_2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
622b
|
27 lines
/* Illustrates the difference between arguments and parameters. */
#include <stdio.h>
float x = 3.5, y = 65.11, z;
float half_of(float k);
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);
}
float half_of(float k)
{
/* k is the parameter. Each time half_of() is called, */
/* k has the value that was passed as an argument. */
return (k/2);
}