Return Statement in C Language

Return Statement in C Language with Examples

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 Language:

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 Does the Return Statement Work in C language?

Return Statement in C Language with Examples

Syntax: return (expression);

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

Output: How Does the Return Statement Work in C language

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.