0 like 0 dislike
22 views
in Computer Science by (1.0m points)
Explain type of functions in C.

1 Answer

0 like 0 dislike
by (1.0m points)
In real time, a function may be defined with or without parameters and a function may or may not return a value. It completely depends upon the user requirement. In this article, We will explain you the types of functions in C Programming language with an example.

In C Programming, As per our requirement, We can define the User-defined functions in multiple ways. The following are list of available types of Functions in C

Function with no argument and no Return value
Function with no argument and with a Return value
Function with argument and No Return value
Function with argument and Return value
NOTE:

From the above, 1 and 3 types does not return any value when the function is called. So, We use void return type while defining the function.
When we call the function 2 and 4 types will return some value. So, We have to use the appropriate data type (int, float, double etc) as return type while defining the function. We use return keyword inside the function to return some value when the function is called from the main() function or any sub-functions.
Types of Functions in C Programming
The Following examples will explain you the available function types in C programming.

C Function with No argument and No Return value
In this method, We won’t pass any arguments to the function while defining, declaring or calling the function. This type of functions in C will not return any value when we call the function from main() or any sub function. When we are not expecting any return value but, we need some statements to be printed as output then, this type of functions in C are very useful.

Related questions

0 like 0 dislike
1 answer 184 views
0 like 0 dislike
1 answer 18 views
0 like 0 dislike
1 answer 40 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 31 views
0 like 0 dislike
1 answer 93 views
0 like 0 dislike
1 answer 30 views
0 like 0 dislike
1 answer 57 views
0 like 0 dislike
0 answers 38 views
asked Feb 15, 2019 in Pak. Studies by danish (1.0m points)
0 like 0 dislike
1 answer 180 views
0 like 0 dislike
1 answer 53 views
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

3.3k users

Free Hit Counters
...