Programming in C—Functions.

in Project HOPE5 months ago
Hello Everyone


Image Source

I hope you all are fine and safe inside your homes. This is a weird time ongoing in the whole world and I hope it will get over soon. As during this time, everyone is locked into their homes. I want to share the C programming language with you. I hope you guys like it, so let's happen today's topic.

Function Prototype

A function prototype is just the declaration of a function that specifies function's name, parameters and return type. It doesn't contain function body.
A function prototype gives information to the compiler that the function may later be employed in the program.
Syntax of Function Prototype

returnType functionName(type1 argument1, type2 argument2,...);

The function prototype isn't needed if the user-defined function is defined before the main() function.

Function Definition

Function definition contains the block of code to perform a selected task i.e. during this case, adding two numbers and returning it.
Syntax of Function Definition

returnType functionName(type1 argument1, type2 argument2, ...)
 //body of the function

When a function is termed, the control of the program is transferred to the function definition. And, the compiler starts executing the codes inside the body of a function.

Function Call

Control of the program is transferred to the user-defined function by calling it.
Syntax of Function Call

functionName(argument1, argument2, ...);


Gif by @doze


Thank you.

I hope you guys liked my post.

Keep Supporting.




Created by @zord189

Stay Home, Stay Safe




Congratulations @peerzadazeeshan! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You distributed more than 19000 upvotes. Your next target is to reach 20000 upvotes.

You can view your badges on your board and compare to others on the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @hivebuzz:

The Hive Gamification Proposal