{"id":6427,"date":"2024-06-01T00:02:31","date_gmt":"2024-06-01T07:02:31","guid":{"rendered":"https:\/\/c-for-dummies.com\/blog\/?p=6427"},"modified":"2024-06-08T08:18:32","modified_gmt":"2024-06-08T15:18:32","slug":"adding-two-values","status":"publish","type":"post","link":"https:\/\/c-for-dummies.com\/blog\/?p=6427","title":{"rendered":"Adding Two Values"},"content":{"rendered":"<h2>Difficulty: &#9733; &#9734; &#9734; &#9734;<\/h2>\n<p>Adding values is a basic programming concept: 4 + 5 = 9 But where do the values come from? They can be literals, variables, expressions, or values collected from the user.<br \/>\n<!--more--><br \/>\nYour task for this month&#8217;s Exercise is to add two values. These values can be fetched from standard input. They could also be read from the command line. The point is that the values are user-supplied. Obtain the values, add them together, then output the result.<\/p>\n<p>Here&#8217;s a sample run from one of my solutions:<\/p>\n<p><code>Enter two values: 5 4<br \/>\n5 + 4 = 9<\/code><\/p>\n<p>You need only code only solution, and you can try to obfuscate it or figure out a complex way beyond what may seem obvious.<\/p>\n<p><a href=\"https:\/\/c-for-dummies.com\/blog\/?p=6432\">Click here<\/a> to view my solutions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It seems simple, but a number of clever solutions are possible. <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=6427\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6427","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\/6427","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=6427"}],"version-history":[{"count":3,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6427\/revisions"}],"predecessor-version":[{"id":6447,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6427\/revisions\/6447"}],"wp:attachment":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}