About Me

Hello there! Before talking about qualifications and professional abilities, I would like to introduce myself. I am a Yuvraj Basnet and professional software developer and have been working in this field for 3 long years. I have finished my graduation from The University of Delhi on Computer Science Engineering I considered myself a reasonably experienced programmer with a particular interest in the human side of software development, computers are fascinating machine, but they're mostly reflection of the people using them. In the art of software development, studying code isn't enough; you have to study the people behind the software, too.

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