{"id":993,"date":"2014-10-01T00:01:15","date_gmt":"2014-10-01T07:01:15","guid":{"rendered":"http:\/\/c-for-dummies.com\/blog\/?p=993"},"modified":"2014-10-11T08:02:28","modified_gmt":"2014-10-11T15:02:28","slug":"the-inverse-pyramid","status":"publish","type":"post","link":"https:\/\/c-for-dummies.com\/blog\/?p=993","title":{"rendered":"The Inverse Pyramid"},"content":{"rendered":"<p>Two things that seem to be difficult for a beginning C programmer are numbers and their formatted presentation. I admit: These things are difficult to understand. Therefore some practice is in order.<br \/>\n<!--more--><br \/>\nThis month&#8217;s exercise involves multiple aspects of the C language. Your task is to create an inverse pyramid of numbers that looks like this:<\/p>\n<pre><code>0000000000\r\n999999999\r\n88888888\r\n7777777\r\n666666\r\n55555\r\n4444\r\n333\r\n22\r\n1<\/code><\/pre>\n<p>To create this output, look in your C language tool chest and pull out the following items:<\/p>\n<ol>\n<li>A loop.<\/li>\n<li>Another loop! (A nested loop.)<\/li>\n<li>Math necessary.<\/li>\n<\/ol>\n<p>Obviously, the code needs to count down from 10 to 1. The problem, of course, is how to display that initial line of ten zeros and not ten 10s. That&#8217;s the <em>math necessary<\/em> part.<\/p>\n<p>A number of ways exist to solve this puzzle. <a href=\"http:\/\/c-for-dummies.com\/blog\/?p=1006\">Click here<\/a> to read about my solution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Time to get upside-down Egyptian with some numbers. <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=993\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-993","post","type-post","status-publish","format-standard","hentry","category-exercise"],"_links":{"self":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=993"}],"version-history":[{"count":8,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/993\/revisions"}],"predecessor-version":[{"id":1045,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/993\/revisions\/1045"}],"wp:attachment":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}