A function is a self contained block of statement that performs a coherent task of some kind.
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) /* function call */
printf("The value of k is %d\n",k);
}
Output:-
The value of k is 30.
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) /* function call */
printf("The value of k is %d\n",k);
}
Output:-
The value of k is 30.
0 Comments:
Post a Comment