Hi guys!
I have the following programm and i want to apply pointers to functions.
// function example
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
float average (float a, float b,float c)
{
float avg;
avg=(a+b+c)/3;
return (avg);
}
float multiplication ( float a, float b,float c)
{
float r;
r=a*b*c;
return (r);
}
void main ()
{
float x, y, z, w, m;
cout<<"Enter three numbers"<<endl;
cout<<"1st number:";
cin>>x;
cout<<"2nd number:";
cin>>y;
cout<<"3rd number:";
cin>>z;
w = average (x,y,z);
cout << "The average result is " << w << '\n';
m= multiplication(x,y,z);
cout << "The multiplication result is " << m << '\n';
getch();
}