filmov
tv
Functions in C Programming Language | C Language Tutorial

Показать описание
#cprogramming #functions
In this video we're going learn about functions in C programming language.
A Function is a Block of code or group of statements that performs a single specific task.
In general there are two types of functions. They are:
● Built-in functions
● User-defined functions
The functions which are already available in libraries or packages are called built-in functions.
For example printf(), scanf(), sqrt() etc.,
What is Return Type − A function may return a value. The return_type is the data type of the value the function returns. Some functions perform the desired operations without returning a value. In that case, the return_type is the keyword void.
Parameters − A parameter is like a placeholder. When a function is invoked, you pass a value to the parameter. This value is referred to as an actual parameter or argument. The parameter list refers to the type, order, and number of the parameters of a function. Parameters are optional; that is, a function may contain no parameters.
Here the parameter is integer N.
How to use these functions?
To use a function, you will have to call that function to perform the defined task.
When a program calls a function, the program control is transferred to the called function. A called function performs a defined task and when its return statement is executed or when its function-ending closing brace is reached, it returns the program control back to the main program.
What are the advantages of functions?
● The program will be easier to understand, maintain and debug.
● Reusable codes that can be used in other programs
● A large program can be divided into smaller modules. Hence, a large project can be divided among many programmers.
You can also create functions as per your need. Such functions created by the user are known as user-defined functions.
For example isLeapYear() function which you created to check whether a year is leap year or not.
Or isPrime() function to check whether a number is prime or not.
#ClawsofPython
Follow Our Social media accounts
Instagram
Twitter
Telegram
How to Crack TCS NQT?
How to crack InfyTQ 2022 Batch with 5 pro Tips
In this video we're going learn about functions in C programming language.
A Function is a Block of code or group of statements that performs a single specific task.
In general there are two types of functions. They are:
● Built-in functions
● User-defined functions
The functions which are already available in libraries or packages are called built-in functions.
For example printf(), scanf(), sqrt() etc.,
What is Return Type − A function may return a value. The return_type is the data type of the value the function returns. Some functions perform the desired operations without returning a value. In that case, the return_type is the keyword void.
Parameters − A parameter is like a placeholder. When a function is invoked, you pass a value to the parameter. This value is referred to as an actual parameter or argument. The parameter list refers to the type, order, and number of the parameters of a function. Parameters are optional; that is, a function may contain no parameters.
Here the parameter is integer N.
How to use these functions?
To use a function, you will have to call that function to perform the defined task.
When a program calls a function, the program control is transferred to the called function. A called function performs a defined task and when its return statement is executed or when its function-ending closing brace is reached, it returns the program control back to the main program.
What are the advantages of functions?
● The program will be easier to understand, maintain and debug.
● Reusable codes that can be used in other programs
● A large program can be divided into smaller modules. Hence, a large project can be divided among many programmers.
You can also create functions as per your need. Such functions created by the user are known as user-defined functions.
For example isLeapYear() function which you created to check whether a year is leap year or not.
Or isPrime() function to check whether a number is prime or not.
#ClawsofPython
Follow Our Social media accounts
Telegram
How to Crack TCS NQT?
How to crack InfyTQ 2022 Batch with 5 pro Tips