0 votes
1 view
in C Programming by (36k points)
recategorized by

Can anyone explain what is a function in C?

1 Answer

0 votes
by (86.8k points)

A function is a group of statements that are written for performing a certain task which you may need to perform regularly. Whenever you want to perform the task, you can call the function.

Defining a Function

Here is how to define a function in the C programming language:

return_type function_name( parameter list ) {

   body of the function

}

Return Type − The return_type defines the data type of the value that the function returns. The return_type is the keyword void if the functions do the operation needed but do not return any value.

Function Name − This is the name of the function.

Parameters − A parameter is like a placeholder. When a function is called, you pass a value referred to the parameter.

Function Body − The function body is a set of statements for performing a certain task.

If you want to learn C programming, then check out this C Language Course by Intellipaat.

Also, watch this YouTube tutorial on C programming:

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...