
Functions 391
Explanation:
In the above program, three values date, month and year are passed to the function dat().
The function displays date. The function dat() returns the next date. The next date is
printed in function main(). Here, function dat() receives arguments and return values.
10.12 Write a program to send values to user-defined function and receive and display the return
value.
{
int dat(int ,int ,int );
int d,m,y,t;
clrscr();
printf(“Enter Date dd/mm/yy : “);
scanf(“%d %d %d”,&d,&m,&y);
t=dat(d,m,y);
printf(“\nTomorrow = %d/%d/%d”,t,m,y);
getch();
}
int dat(int x, int y, int z)
{
printf(“\nToday = %d/%d/%d”,x,y,z);
return(++x); ...