CSC211
Handout #3 Functions
#include <iostream>
#include <cmath>
using namespace
std;
void display_mix(int x, float &
z);
int main( )
{
float w = 3.0;
int y=5 ;
display_mix(2,
w);
cout<<"First time function is called, w="<<w<<endl;
display_mix(y,
w);
cout<<"Second time function is called, w="<<w<<endl;
cout<<"Done !"<<endl;
return 0;
}
void display_mix(int x, float & z)
{
float result;
result=
pow(x, 2.0) + z;
cout<<"Result is:\t"<<result<<endl;
}