Detailed Discription of Category of Functions with Examples

Engg.... | 21:23 | | | Best Blogger Tips
Category of Functions

Category of Functions:
We have some other type of Functions where arguments and return value may be present or absent. Such functions can be categorised into:
  1. Function with arguments but no return value.
  2. Function with no arguments and return value.
  3. Functions with no arguments and no return values

So Let's have a look on Category of Functions one by one:

1. Function with Arguments but no return value: 
Here the called Function recieves the data from the calling function but the called function does not return any value back to the calling Function.So, let us understand with the help of Program:

Statement of C Program: This Program illustrates the Function with arguments but no return value:

void main()
int a, b;
printf(" Enter the value of a and b\n");
scanf("%d%d" , &a ,&b);
largest(a, b);

/* Function to compute largest */

largest(c, d)
int c, d;
printf(" Largest = %d\n");
else                                                    /* (c<d) */
printf(" Largest = %d\n");

Enter the values of a and b
Largest = 20

                                     Function with no Arguments and Return Values                                

                                  Functions with no Arguments and no Return Values                             
Please Share it! :)
Do you like this Story?

Get Free Email Updates Daily!

Follow us!