C++ examples for Function:Function Creation
Writing Your Own Functions with parameter
#include <iostream> using namespace std; int AddOne(int start) { int newnumber;/*from w w w . j av a2s . com*/ newnumber = start + 1; return newnumber; } int main() { int testnumber; int result; testnumber = 20; result = AddOne(testnumber); cout << result << endl; return 0; }