Student Portfolio >> Index >> Coding >> Exercise 3
#include <iostream.h> float larger(float, float); //function prototype int main()
{
float tempval1, tempval2, larger_num=0;
cout << "Please enter first number: ";
cin >> tempval1;
cout << "-----------------------------------------";
cout << " \n";
cout << "Please enter second number: ";
cin >> tempval2;
cout << "-----------------------------------------";
cout << " \n";
larger_num = larger(tempval1, tempval2); //function call // write to screen ------------------------------ cout << " \n"; cout << " \n"; cout << "The larger of the two number is : " << larger_num; cout << " \n"; cout << " \n"; cout << " \n"; return 0; //return value of main
}
<< Back Forward >> |
Copyright 2005 Kerstin Kegel