{"id":119,"date":"2018-02-26T20:55:34","date_gmt":"2018-02-27T01:55:34","guid":{"rendered":"http:\/\/www.news.silkrooster.com\/?page_id=119"},"modified":"2018-02-26T21:04:11","modified_gmt":"2018-02-27T02:04:11","slug":"language-c-no-runtimes-required","status":"publish","type":"page","link":"http:\/\/www.news.silkrooster.com\/?page_id=119","title":{"rendered":"Language C++, no runtimes required."},"content":{"rendered":"<h2><\/h2>\n<p># include &lt;iostream&gt;<br \/>\n# include &lt;iomanip&gt;<br \/>\n\/\/ import header files to use import\/export and formatting commands<br \/>\nusing namespace std;<br \/>\n\/\/ reduces typing code otherwise &#8220;cout&#8221; would be typed as std::cout<br \/>\nint main()<br \/>\n\/\/start of the code<br \/>\n{<br \/>\nint x = 0;\/\/our first variable called x with a value of 0<br \/>\nint y = 0;\/\/our second variable called y with a value of 0<br \/>\nchar hold = 0;\/\/ This variable will store a character rather than an integer like the previous two variables.<br \/>\nint value = 0;<br \/>\nint i = 0;<br \/>\ncout &lt;&lt; &#8221; Multiplication Table\\n\\n\\n\\n&#8221;;\/\/our first output to the screen<br \/>\ncout &lt;&lt; &#8221; &#8220;;\/\/outputs some black characters to the screen<br \/>\nfor (i= 1; i != 11;i++)\/\/This is a for loop, using a variable &#8220;i&#8221; with a value starting at 1 and keeps incrementing until it reaches 11 and finally exits the loop.<br \/>\n\/\/This loop output the number 1 through 10 across the top of the screen<br \/>\n{<br \/>\ncout &lt;&lt; setw(5) &lt;&lt; i;\/\/outputting the variable i to the screen with a width of 5<br \/>\n}<br \/>\ncout &lt;&lt; &#8220;\\n &#8220;;\/\/Starts a new line on the screen following some spaces.<\/p>\n<p>for (i= 1; i != 11;i++)\/\/ This loop will output the &#8220;_&#8221; character across the screen<br \/>\n{<br \/>\ncout &lt;&lt; &#8220;_____&#8221;;<br \/>\n}<br \/>\ncout &lt;&lt; endl &lt;&lt; endl;\/\/endl means end line or return character which will start a new line.<\/p>\n<p>for (y = 1; y != 11; ++y)\/\/here is the meat and potatoes of the table<br \/>\n{<br \/>\ncout &lt;&lt; setw(3) &lt;&lt; y &lt;&lt; &#8220;|&#8221;;\/\/output a number then the | character to give us the numbers running down the side of the screen<br \/>\nfor (x = 1; x != 11; ++x)\/\/this loop will output the multiplication values of the table it self, going across, then new line repeating until 10 x 10 is reached<br \/>\n{<br \/>\nvalue = x*y; \/\/ here we did something a bit different, we are placing the multiple of &#8220;x&#8221; and &#8220;y&#8221; into the varible &#8220;value&#8221;.<\/p>\n<p>cout &lt;&lt; setw(5) &lt;&lt; value;\/\/ and here we output the varible &#8220;value&#8221;<br \/>\n}<br \/>\ncout &lt;&lt; &#8221; &#8221; &lt;&lt; endl &lt;&lt; endl;<br \/>\n}<\/p>\n<p>cout &lt;&lt; &#8220;\\n\\nPress the red X in the upper right hand corner to close window&#8221; &lt;&lt; endl; cin &gt;&gt; hold;\/\/ This keep the screen open so the user can see the output.<\/p>\n<p>return 0;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p># include &lt;iostream&gt; # include &lt;iomanip&gt; \/\/ import header files to use import\/export and formatting commands using namespace std; \/\/ reduces typing code otherwise &#8220;cout&#8221; would be typed as std::cout int main() \/\/start of the code { int x = &hellip; <a href=\"http:\/\/www.news.silkrooster.com\/?page_id=119\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":97,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-119","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=\/wp\/v2\/pages\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":1,"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=\/wp\/v2\/pages\/119\/revisions"}],"predecessor-version":[{"id":120,"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=\/wp\/v2\/pages\/119\/revisions\/120"}],"up":[{"embeddable":true,"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=\/wp\/v2\/pages\/97"}],"wp:attachment":[{"href":"http:\/\/www.news.silkrooster.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}