C++ examples for Function:Function Parameter
Create function to calculate area of circle
#include <iostream> using namespace std; float circarea(float radius); int main()/*from w w w .j a va 2 s .c o m*/ { double rad; cout << "\nEnter radius of circle: "; cin >> rad; cout << "Area is " << circarea(rad) << endl; return 0; } float circarea(float r) { const float PI = 3.14159F; return r * r * PI; }