-moz-user-select:none; -webkit-user-select:none; -khtml-user-select:none; -ms-user-select:none; user-select:none;

Thursday 14 May 2015

Simple example of function

Hello and Asalam o Alikum.

I have shifted to dev C++ compiler.So, from now onward, the programs of my blog would be written in dev c++ compiler.

Today I am here with the simplest example of function. It is about printing a simple statement in C++ using function.

One concept which is important and I want to mention here is "parameters".

Parameters

Parameters are the values that are provided to a function when the function is called.If there is no parameter, only parenthesis are used.

Below is the source code of that simple example of function which I mentioned above.

Source code


simple example of function


Output

Output

Explanation:
 

Line # 4 : 

             This is actually a function declaration and the empty parameter shows that it has no argument.

Line # 7:

              It is a function call.

Line # 10:

                  it is a function definition that tells what a function actually does.

No comments:

Post a Comment