#Mastery18<\/a><\/p>\nIn addition to chaining of conditionals you can nest one conditional to another. Like in the example below:<\/p>\n
<\/p>\n
if (x == 0) {<\/code><\/p>\n cout << \"x is zero\" << endl;<\/code><\/p>\n} <\/code><\/p>\nelse {<\/code><\/p>\n if (x > 0) {<\/code><\/p>\n cout << \"x is positive\" << endl;<\/code><\/p>\n } else {<\/code><\/p>\n cout << \"x is negative\" << endl;<\/code><\/p>\n }<\/code><\/p>\n}<\/code><\/p>\n <\/p>\n
I put the code before in my editor and I compliled and run it to see how it works, I realize that actually it works!! So, we can nest conditionals into another conditionals.<\/p>\n
<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"
Hello #TC1017 as mi title says this post is about nested conditionals. #Mastery18In addition to chaining of conditionals you can nest one conditional to another. Like in the example below: if (x == 0) { cout << “x is zero” <… Continue reading →<\/span><\/a><\/p>\n","protected":false},"author":95,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,26],"tags":[180,40],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/6158"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/users\/95"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/comments?post=6158"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/6158\/revisions"}],"predecessor-version":[{"id":7676,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/posts\/6158\/revisions\/7676"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/media?parent=6158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/categories?post=6158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2015\/wp-json\/wp\/v2\/tags?post=6158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}