C Function

What is Function?

  • A function is a block of code which only runs when it is called.

(একটি ফাংশন হল কোডের একটি ব্লক যা শুধুমাত্র কল করলেই চলে।)

  • You can pass data, known as parameters, into a function..

(আপনি একটি ফাংশনে ডেটা পাস করতে পারেন, যা প্যারামিটার নামে পরিচিত।)

  • C have 2 types of function:

  1. Predefined Functions.{ int main() is a predefined function. }

  2. User defined functions.

Syntax of user defined functions:

Example :

Output:

Note: When we use string then dataType must be void. Because void means return nothing. See the example:

Example :

Output:

Example : (when multiple time function call)

Output:

Example : (C Function Parameters)

Output:

Example : (Multiple Parameters)

Output: