Riya Keshware
C Cpp
3 Donated Notes

what is function?

function 

function is nothing but a group of statements which takes number of inputs and after processing gives single output.we write it once and can use multiple times with in a program. function has three parts :-

1.function declaration and prototyping 

2.function defination

3.function calling 

1.function declaration and prototyping :-in prototyping ,we declare the function before main function with semi colon that can tells to compiler what type of functions will be performed in to the program.

when we declare the function prototyping in parentheses, we only put the datatype of inputs.

syntax :return_type function_name (datatype of inputs);

in function declaration, we declare the function before defining the function or during function definition without semi colon.when we declare the function during definition, in parentheses we pass the input variable with there datatypes.

syntax :-return_type function_name (number of inputs with there datatypes

2.function definition :-in function definition,we start defining the function with curly braces  after declare the function.we can say that function definition is a main body of function.what type of task will be perform we write it in the definition as a statements and close with curly braces.

syntax :-return_type function_name (number of inputs with there datatypes

{

number of statements; //function definition 

}

3.function calling:- in function calling, we call the function in to main() function.we can call the function multiple times.and during call we pass actual arguments in parentheses with semi colon. 

syntax:

main()

{

function_name(actual arguments);

}

Other Articals By Riya keshware


Click Here For Donating Articals & Be Popular

Artical Categories

Subjects

Android

Learn Android

C

Learn C

Cpp

Learn Cpp

Css

Learn Css

Html

Learn Html

Java

Learn Java

Js

Learn Js

Net

Learn Net

Other

Learn Other

Php

Learn Php

Python

Learn Python

Uiux

Learn Uiux