Pass value to a function via parameter - C++ Function

C++ examples for Function:Function Parameter

Description

Pass value to a function via parameter

Demo Code

#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;
}

Result


Related Tutorials