<\/p>\n
if<\/code>, <\/span>if...else<\/code> and nested <\/span>if...else<\/code> statement are used to make one-time decisions in C++ Programming, that is, to execute some code\/s and ignore some code\/s depending upon the test condition. Without decision making, the program runs in similar way every time. <\/span><\/h1>\nThe <\/span>if<\/code> statement checks whether the test condition is true or not. If the test condition is true, it executes the code\/s inside the body of <\/span>if<\/code> statement. But it the test condition is false, it skips the code\/s inside the body of <\/span>if<\/code> statement.<\/span><\/span><\/h1>\nThe <\/span>if<\/code> keyword is followed by test condition inside parenthesis ( ). If the test condition is true, the codes inside curly bracket is executed but if test condition is false, the codes inside curly bracket { } is skipped and control of program goes just below the body of <\/span>if<\/code> as shown in figure above.<\/span><\/span><\/h1>\nI found the code shown in the picture in http:\/<\/wbr>\/<\/wbr>www.tutorialspoint.com\/<\/wbr>cplusplus\/<\/wbr>cpp_nested_if.htm<\/a> and information in http:\/<\/wbr>\/<\/wbr>www.programiz.com\/<\/wbr>cpp-programming\/<\/wbr>if-else <\/a><\/span><\/span><\/h1>\nJust simple conditionals!<\/span><\/span><\/h1>\n <\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"
#Mastery18 #TC1017The if, if…else and nested if…else statement are used to make one-time decisions in C++ Programming, that is, to execute some code\/s and ignore some code\/s depending upon the test condition. Witho… Continue reading