About Me

Hey friends! My name is yuvraj basnet. I'm going to introduce myself.I have born and grown up in india(chandigarh) and I'm studying second year of B.C.A computer science field. My father serving in indian air force. My mother has been taking care of house hold. I am a friendly person, good thinker, I can work for longer hours without any break, only if I'm interested in that...My life style is very simple.

PART- II FUNCTION IN C

In previous tutorial you learn function definition, function declaration, function call and how the function is called(call by value and call by reference.
Now, in this tutorial you learn C - Argument, return value.


   All C functions can be called either with arguments or without arguments
   in a C program. These functions may or may not return values to the 
   calling function.
  1. C function with arguments (parameters) and with return value.
  2. C function with arguments (parameters) and without return value.
  3. C function without arguments (parameters) and without return value.
  4. C function without arguments (parameters) and with return value.

1)C function with arguments (parameters) and with return value.
   The return type of this function is “int” and value of the variable 
   “a” is returned from the function. The values for array and string 
    are modified inside the function itself.


                                                                        OUTPUT

2)C function with arguments (parameters) and without return value.
   In this program, integer, array and string are passed as arguments 
   to the function. The return type of this function is “void” and no 
   values can be returned from the function. All the values of integer, 
   array and string are manipulated and displayed inside the function itself.

OUTPUT

3)C function without arguments (parameters) and without return value.
    In this program, no values are passed to the function “temp” and no values are 
    returned from this function to main function.


                                                                          OUTPUT




4)C function without arguments (parameters) and with return value.
    In this program, no arguments are passed to the function “multi”. 
    But, values are returned from this function to main function. Values
    of the variable and b are multiplying in the function “multi” and 
    the product of these value is returned to the main function.

       
                                                               OUTPUT     

Post a Comment

0 Comments