Within the body of the method, you use the return statement to return the value. Any method declared void doesn't return a value and cannot contain a return statement. Any method that is not declared void must contain a return statement.
The status "returned" in an assignment means that the teacher has received your assignment, graded or not the assignment and then returned it to you.
The built-in assignment operators return the value of the object specified by the left operand after the assignment (and the arithmetic/logical operation in the case of compound assignment operators). The resultant type is the type of the left operand. The result of an assignment expression is always an l-value.
The void keyword specifies that the function should not return a value. Moreover, if we want the function to return a value, we have to use a data type (such as int, string, etc.) instead of the void. After that, use the return keyword inside the function provided.
The built-in assignment operators return the value of the object specified by the left operand after the assignment (and the arithmetic/logical operation in the case of compound assignment operators). The resultant type is the type of the left operand. The result of an assignment expression is always an l-value.
The assignment operator will (still) update the value stored inside the variable var. In addition to updating the variable. the assignment operator also returns a value.
To return a value from a function, you must include a return statement, followed by the value to be returned, before the function's end statement. If you do not include a return statement or if you do not specify a value after the keyword return, the value returned by the function is unpredictable.