According to a book I read you can pass variables from one function to another by passing by value/address. When you pass by address it will no longer preserve the variable if it is changed in a function and returned back to the original function (ex: main()). The very next chapter, the book reviews returning values. In this chapter it explains the use of return(variable); but doesn't explain a clear purpose. Is return(variable); used when multiple variables are passed to a certain function to return only one? Or are there other uses? In other words, what's the difference between return; and return(variable);?Passing by address, exact book example without return(num);:#include <stdio.h>main(){    int i;    i = 4    printf(Before: %d.\n, i);    half(&i);    printf(After: &d.\n, i);    return (0);}half (int *i){    *i = *i / 2;    printf(During: %d.\n, *i);    return;}Returning Values, exact book example with return(num);:#include <stdio.h>float gradeAve(float test1, float test2, float test3);main(){    float grade1, grade2, grade3;    float average;    printf(What was the grade on the first test? );    scanf( %f, &grade1);    printf(What was the grade on the second test? );    scanf( %f, &grade2);    printf(What was the grade on the third test? );    scanf( %f, &grade3);    average = gradeAve(grade1, grade2, grade3);    printf(\nWith those three test scores, the average is %.2f, average);    return 0;}float gradeAve(float test1, float test2, float test3){    float localAverage;    localAverage = (test1+test2+test3)/3;    return (localAverage); }How can both of these return values to original function with or without return(num);?
Difference between passing by values/address and returning a values through functions?
c;return type
How can both of these return values to original functionThey don't; your book is badly-worded.In the second case:average = gradeAve(grade1, grade2, grade3);gradeAve returns - literally with a return statement - its result. Here the function parameters (grade1..3) are just inputs, and the whole call looks like a mathematical expression.In the first case:half(&i);nothing is returned. The caller's local variable, i, is mutated by the function half, so that afterwards its value is different. This is called an out-parameter, meaning one of the function's parameters is used for output from the function, instead of input to the function as is usually the case.This style usually isn't preferred because it is less clear: there's nothing to tell me when reading the calling code that i is changed by the call until I also read the implementation of half.The main exception is when the out-parameter is large in size (so would be expensive to copy by value in a return statement), or is an object with some kind of identity rather than a simple value.One source of confusion (apart from the poor wording in the book) is that return does two things:passing a result from a function back to the callerpassing control from a function back to the callerSo for example:void mutate(int *i) {  if (*i < 0) {    return; /* just quit the function early */  }  (*i) = mutate_nonnegative(*i);  /* return is implied here */}uses meaning #2 only, whileint mutate_nonnegative(int i) {  if (i % 2) {    return 3 * i; /* triple odd numbers */  } else {    return 2 * i; /* double even numbers */  }}uses both #1 and #2 (it quits the function and returns to the caller at different points, passing the caller a different value at each).