TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Thursday, 14 May 2020

Function Prototype In C | Function Prototype In C Example | Function Prototype In C In Hindi

Function Prototype


A function prototype is simply the declaration of a function that specifies function’s name, parameters and return type. It’s doesn’t contain function body.

A function prototype gives information to the compiler that the function may later be used in the program.

 

image of function prototype in c

Fig: function prototype

 

Syntax of function prototype

 

returtype  functionname(type1 agrugment1,type2 argument2….);

The function prototype which provides the following information to the compiler.

1. name of function is addnumber()

2. return type function is int()

3. two argument of type int() are passed to the function.

The function prototype is not needed if user-define function is defined before the main()  function.

 

Calling a function

 

Control of the function  is transferred to the user-defined function  by calling it.


Syntax of function call

 

functionname(argument1, argument2….);

 

Passing argument to a function

 

The parameters a and b accepts the passed argument in the function definition.

These argument are called formal  parameters of the function.


image of passing argument function in c

Fig: Passing argument

Return Statement

 

The return statement terminates the execution of a function and return a value of the calling function. The program control is transferred to the calling function after the return statements.


image of return statement function in c

Fig: return statement

Syntax of return statement
 

return(expression);

 

Example:

 

return  a;


No comments:

Post a Comment