Return Statement in C Language

Return Statement in C Language

In this article, I am going to discuss Return Statement in C Language with examples. Please read our previous articles, where we discussed Continue Statement in C. At the end of this article, you will understand what is Return Statement in C and when and how to use the Return statement in C with examples.

Return Statement in C:

The return statement terminates the execution of a function and returns control to the calling function. Execution resumes in the calling function at the point immediately following the call. A return statement can also return a value to the calling function. A return statement causes your function to exit and hand back a value to its caller. The point of functions, in general, is to take in inputs and return something. The return statement is used when a function is ready to return a value to its caller.

How return statement works in C?

How return statement works in C?

Syntax: return (expression);

Program to understand the return statement in c:
#include <stdio.h> 
void print() // void method 
{ 
   printf("Return Statement"); 
} 
int main() 	// Driver method 
{ 
    print(); // Calling print 
    return 0; 
}

Output:

Program to understand return statement in c

In the next article, I am going to discuss the Goto Statement in C Language with examples. Here, in this article, I try to explain Return Statement in C Language with examples. I hope you enjoy this article. I would like to have your feedback. Please post your feedback, question, or comments about this article.

Leave a Reply

Your email address will not be published. Required fields are marked *