Write a C Program to return more than one value from a function

By | March 19, 2017

C Program to return more than one value from a function


Write a C Program to return more than one value from a function using Call By Reference. Here’s a Simple Program to return more than one value from a function using Call By Reference in C Programming Language.


Call by Reference


If data is passed by reference, a pointer to the data is copied instead of the actual variable as is done in a call by value. Because a pointer is copied, if the value at that pointers address is changed in the function, the value is also changed in main().

In call by reference, original value is modified because we pass reference (address).

Here, address of the value is passed in the function, so actual and formal arguments shares the same address space.

Hence, value changed inside the function, is reflected inside as well as outside the function.


In this program, we pass the variables or arguments to the function and uses pointer to calculate Sum, Difference and Multiplication of variables and return multiple values after function call.

Below is the source code for C Program to return more than one value from a function using Call By Reference which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT  : :



If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach upto you in the short interval.


Thanks for reading the post.

Leave a Reply