Returning Function or Returning Method
Returing method is the direct opposite of void method. Returning method will return a value. In order to declare returning method , We need to use a datatype before method name and inside that method we need to use return keyword and we need to return a value. In order to understand this clearly let us study this with a code example.
CODE
EG 1 . Creating a returning method and trying to store inside variable, printing out in console and doing arithmetic Calculation.
#include <iostream>
using namespace std;
double DegreeToRadian(double degree);
int main() {
    //storing returning method inside a variable
    double result = DegreeToRadian(30);
    cout << result << endl;
    //printing out returning method in console
    cout << DegreeToRadian(30) << endl;
    //Arithmetic Calculation in returning method.
    cout << DegreeToRadian(30)*2/180 << endl;
    //(Ultimate goal)Assume we created DegreeToRadian method to calculate sin(30 degree)
    cout << sin(DegreeToRadian(30)) << endl;
}
double DegreeToRadian(double degree) {
    return degree * Math.PI / 180;
}
(Click Here, For more exercises)