Making Nested Function Calls - C++ Function

C++ examples for Function:Function Creation

Description

Making Nested Function Calls

Demo Code

#include <iostream>
#include <cstdlib>

using namespace std;

int myFunc1()/*  w  w w  .j  a v a 2  s.  co m*/
{
    return 4;
}

int myFunc2()
{
    return 10 * myFunc1();
}

int myFunc3()
{
    return myFunc2() + 25;
}

int main()
{
    cout << myFunc3() << endl;
    return 0;
}

Result


Related Tutorials