Writing Your Own Functions with parameter - C++ Function

C++ examples for Function:Function Creation

Description

Writing Your Own Functions with parameter

Demo Code

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

Result


Related Tutorials