C++ examples for Function:Function Parameter
Pass value to a function via parameter
#include <iostream> using namespace std; void showit(double, double); // function prototype int main()/* w w w .j a v a 2 s . c o m*/ { showit(5.0, 53.1301); return 0; } void showit(double radius, double angle) { cout << "\nThe polar coordinates are: " << endl; cout << " Distance from origin: " << radius << endl; cout << " Angle (in degrees) from x-axis: " << angle << endl; return; }