Ad Code

NEW POST

6/recent/ticker-posts

HOW TO MAKE FUNCTION AND CALL IT IN C LANGUAGE


TIMER:

UNDERSTAND THIS CODE 300 seconds.


 WHAT ARE FUNCTIONS?

> Functions are the block of code that only runs when it is called


> You can pass data known as parameters into a functions


> The function is used to perform a certain action and they are important for resuing code


> Define the code once and use it many times is the use of functions...


HOW TO CREATE A FUNCTION?


(RETURN TYPE)   FUN_NAME()  //FUNCTION NAME

{//BODY OPENS

STATEMENTS...

}//BODY CLOSES


FUNCTION CAN BE DEFINED FROM TWO TYPES:


EX-1

void show( )    //we can use void because void means null value means it returns null value

{

//statement

}

advantages are

> no use of return 0; or getch();

>less number of lines of codes.


EX-2

int main()

{

//statement

return 0;

}

Post a Comment

0 Comments