Share
i want to know Define function. What are the advantage of using function? How can we declare function? Write down its' syntax. for [2+2+6] marks
In progress
Programming, C
12 Mar 2025
8 views
Answers ( 1 )
Define function :- A function is a block of code that performs a specific task and can be use multiple times in a program. Functions help in organiz code efficiently by breaking it into small parts.
Advantages function :
Code Reusability :- The same function multiple times without writing the same code again. Instead of repeating code, you just call the function whenever needed.
Modularity :- functions divide a program into smaller parts, making it easier to understand, fix errors, and update without affecting the whole program.
Function declar :- A function is declared using a specific syntax, depending on the programming language. In C, a function is declared as follows:
Eg.
Here,
add()
is a function that takes two integers as input and returns their sum.