C Tutorial/Function/Function Introduction
Function
Functions provides modularity to the software.
#include <stdio.h>
int add (int x, int y) {
int z;
z = x + y;
return (z);
}
main ()
{
int i, j, k;
i = 10;
j = 20;
k = add(i, j);
printf ("The value of k is %d\n", k);
}
The value of k is 30