Function

 Function

In this post we are going to what is function statement?
A function is a set of statements that take inputs, do some specific computation and produces output.

The idea is to put some commonly or repeatedly done task together and make a function so that instead of writing the same code again and again for different inputs, we can call the function.

Function is a very useful statement. In every programming language, whenever we want to repeat any set of program with different data or any condition and etc, at that time we can use function.




Here you can see the pic of function example program. It's a simple program from here you will be know how the function statement works... In this program you can see the function named "sayHi()" is defined whose work is to print "HI friends" when it will be called. At program line number 9 you can see the function is called and you can also see the result at output screen(black flow). According to  function it written "HI friends".

It's simple, aren't it?☺

Post a Comment (0)
Previous Post Next Post