Function With No Arguments and No Return Value
Function With No Arguments and No Return Value
categorised as:
Let's take an example to find whether a number is prime or not using above 4 categories of user
defined functions.
Function prime() is used for asking user a input, check for whether it is prime of not and display it
accordingly. No argument is passed and returned form prime() function.
Here, check_display() function is used for check whether it is prime or not and display it
accordingly. Here, argument is passed to user-defined function but, value is not returned from it to
calling function.
Here, check() function is used for checking whether a number is prime or not. In this program, input
from user is passed to function check() and integer value is returned from it. If input the number is
prime, 0 is returned and if number is not prime, 1 is returned. A function that calls itself is known as
recursive function and this technique is known as recursion in C programming.