/*https://[Log in to view URL]
The return statement returns the flow of the execution to the function from where it
is called. This statement does not mandatorily need any conditional statements.
As soon as the statement is executed, the flow of the program stops immediately
and returns the control from where it was called.
The return statement may or may not return anything for a void function, but for
a non-void function, a return value must be returned.*/
// C code to illustrate Methods returning
// a value using return statement
#include <stdio.h>
// non-void return type
// function to calculate sum
int SUM(int a, int b)
{
int s1 = a + b;
// method using the return
// statement to return a value
return s1;
}
// Driver method
int main()
{
int num1 = 10;
int num2 = 10;
int sum_of = SUM(num1, num2);
printf("The sum is %d", sum_of);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: