{"id":606,"date":"2025-07-21T09:43:34","date_gmt":"2025-07-21T09:43:34","guid":{"rendered":"https:\/\/tipcontrol.com\/?page_id=606"},"modified":"2025-07-21T09:43:35","modified_gmt":"2025-07-21T09:43:35","slug":"return-statement","status":"publish","type":"page","link":"https:\/\/tipcontrol.com\/?page_id=606","title":{"rendered":"return statement"},"content":{"rendered":"\n<p>The <code>return<\/code> statement in Tipcontrol is used to exit a function and return a value to the function\u2019s caller. It signifies the end of a function&#8217;s execution.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Structure of a&nbsp;<code>return<\/code>&nbsp;Statement<\/h4>\n\n\n\n<p>The basic structure of a <code>return<\/code> statement is:<\/p>\n\n\n\n<p><strong>Components<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>return<\/code>\u00a0Keyword<\/strong>: Indicates that the function is terminating.<\/li>\n\n\n\n<li><strong>Value<\/strong>\u00a0(required):The expression specifies what value to return. The return value does not have to be used, and typically an in other languages empty return will be return(NIL);<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Simple Example<\/h4>\n\n\n\n<p>#include &lt;stdio.h&gt;<\/p>\n\n\n\n<p>\/\/ Function that returns the square of a number<\/p>\n\n\n\n<p>&nbsp; &nbsp; result = number * number;<\/p>\n\n\n\n<p>&nbsp; &nbsp; return(result); \/\/ Return the calculated square, can alos use return(number*number);<\/p>\n\n\n\n<p>\/\/ Function with no return value{<\/p>\n\n\n\n<p>&nbsp; &nbsp; lib.log(&#8220;Hello, World!&#8221;);<\/p>\n\n\n\n<p>&nbsp; &nbsp; return(NIL); \/\/ Optional, since the function is void<\/p>\n\n\n\n<p><strong>Explanation<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u00a0The\u00a0<code>return result;<\/code>\u00a0statement exits the function and provides a value back to the caller, if no value is needed typically NIL is returned.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The return statement in Tipcontrol is used to exit a function and return a value to the function\u2019s caller. It signifies the end of a function&#8217;s execution. Structure of a&nbsp;return&nbsp;Statement The basic structure of a return statement is: Components: Simple Example #include &lt;stdio.h&gt; \/\/ Function that returns the square of a number &nbsp; &nbsp; result [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-606","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/tipcontrol.com\/index.php?rest_route=\/wp\/v2\/pages\/606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tipcontrol.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tipcontrol.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tipcontrol.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tipcontrol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=606"}],"version-history":[{"count":1,"href":"https:\/\/tipcontrol.com\/index.php?rest_route=\/wp\/v2\/pages\/606\/revisions"}],"predecessor-version":[{"id":607,"href":"https:\/\/tipcontrol.com\/index.php?rest_route=\/wp\/v2\/pages\/606\/revisions\/607"}],"wp:attachment":[{"href":"https:\/\/tipcontrol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}