#include
/* double_triple function begins */
int
double_triple (int x, int *d)
{
int t;
*d=2*x; /* double "returned" via pointer */
t=3*x;
return (t); /* triple returned the standard way */
}
/* double_triple function ends */
/* main program begins */
int
main(void)
{
int a,twice,thrice;
a=10;
thrice = double_triple (a, &twice);
printf("%d is two times %d.\n",twice,a);
printf("%d is three times %d.\n",thrice,a);
return(0);
}
No comments:
Post a Comment