As the return keyword itself suggest that it is used to return something.At any time in a method, the return statement is used to cause the whole method to return a certain value and ignore all the statements underneath it.
Whenever a continue statement is executed, the rest of the statements within the body of the loop are skipped and the conditional expression in the loop is executed.
Syntex :-
return;
(or)
return value;
Q.) C++ code to show using return statement in void return type function.
#include < iostream>
using namespace std;
// void method
void Print()
{
cout << "Welcome to shineskill.";
// void method using the return statement
return;
}
// Driver method
int main()
{
// Calling print
Print();
return 0;
}