***functions which return information to the celler*** example of a function which accepts data via parameters and return a rest to the calling program is as follows: float calc_average(int num1, int num2) { float result result = (num1 + num2) * 12 return result; } ex: #include float calc_wages(int hours, float rate); //note1 void main(void) { int hours_worked; float hourly_rate, weekly_wage; cout <<"Enter the number of hours worked :"; cin >> hours_worked; cout <<"Enter the hourly pay rate :"; cin >> hourly_rate; weekly_wage = calc_wages(hours_worked, hourly_rate); //note2 cout <<"The wage is " << weekly_wage << endl; } float calc_wages(int hours, float rate) //note3 { float wage; wage = hours * rate; return wage; //note4 } //the difference between this program and the previous versions are as follows: //note 1: the return type of the function has been changed from void(returns nothing) to float(returns floating point value) //note 2: the value returning from the function is captured(or assigned to) the variable weekly_wage //note 3: the return tupe is float now, not void as before //note 4: the function, having calculated the wage, returns it to the main program by using special statement: return wage; -------------------------------------------------------------------------------------- #include int calc_sum(int num1, int num2); void main(void) { int int_num1, int_num2, sum; cout <<"Enter the 1st number :"; cin >> int_num1; cout <<"Enter the 2nd number :"; cin >> int_num2; sum = calc_sum(int_num1, int_num2); cout <<"The sum is " << sum << endl; } int calc_sum(int num1, int num2) { int sum; sum = num1 + num2; return sum; }