Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in C Programming by (55.6k points)
recategorized by

Can anyone explain what is a function in C?

1 Answer

0 votes
by (119k 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 Programming Online Course by Intellipaat

Also, watch this YouTube tutorial on C programming:

Related questions

0 votes
1 answer
asked Jul 7, 2020 in C Programming by Sudhir_1997 (55.6k points)
0 votes
3 answers
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...