{"id":2648,"date":"2021-08-28T17:17:58","date_gmt":"2021-08-28T17:17:58","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=2648"},"modified":"2021-09-03T06:08:31","modified_gmt":"2021-09-03T06:08:31","slug":"the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/","title":{"rendered":"The construct \u201cif (condition) then A else B\u201d is used for which of the following purposes ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<p class=\"color-pink\">The construct \u201cif (condition) then A else B\u201d is used for which of the following purposes ?<\/p>\n<div class=\"row\">\n<div class=\"col-sm-6\">\n<p>A. Decision making<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>B. Iteration<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>C. Recursion<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>D. Object oriented programming<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-a-decision-making\"><b>Answer :\u00a0<\/b>A. Decision making<\/h3>\n<div class=\"subheading\">\n<h2 id=\"explanation\">Explanation:<\/h2>\n<\/div>\n<div class=\"subheading\">\n<h2 id=\"if-else-for-decision-making\" class=\"color-green\">If-Else for Decision Making:<\/h2>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won\u2019t. But what if we want to do something else if the condition is false. Here comes the else statement. We can use the else statement with if statement to execute a block of code when the condition is false.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer :\u00a0A. Decision making<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16505],"tags":[16460,16458,16459,16461,16456,16457,2068,16462,16463,2034,16431],"class_list":["post-2648","post","type-post","status-publish","format-standard","hentry","category-recursion-and-iteration","tag-decision-making-and-branching-in-c","tag-decision-making-and-looping-in-c","tag-decision-making-statement-program","tag-decision-making-statements","tag-decision-making-statements-in-c","tag-decision-making-statements-in-c-with-examples","tag-if-else-statement-in-c","tag-if-statement-in-c","tag-looping-statements-in-c","tag-switch-statement-in-c","tag-tcs-ninja-coding-questions-with-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Recursion and Iteration Examples - wikitechy<\/title>\n<meta name=\"description\" content=\"Recursion and Iteration Examples- Decision making - The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won\u2019t.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recursion and Iteration Examples - wikitechy\" \/>\n<meta property=\"og:description\" content=\"Recursion and Iteration Examples- Decision making - The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won\u2019t.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-28T17:17:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-03T06:08:31+00:00\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/recursion-and-iteration\\\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/recursion-and-iteration\\\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\\\/\"},\"author\":{\"name\":\"Editor\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"headline\":\"The construct \u201cif (condition) then A else B\u201d is used for which of the following purposes ?\",\"datePublished\":\"2021-08-28T17:17:58+00:00\",\"dateModified\":\"2021-09-03T06:08:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/recursion-and-iteration\\\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\\\/\"},\"wordCount\":119,\"commentCount\":0,\"keywords\":[\"decision making and branching in c\",\"decision making and looping in c\",\"decision making statement program\",\"decision making statements\",\"decision making statements in c\",\"decision making statements in c with examples\",\"if else statement in c\",\"if statement in c\",\"looping statements in c\",\"switch statement in c++\",\"TCS Ninja Coding Questions with Answers | TCS Ninja Coding Questions 2021 | TCS Ninja Programming MCQ Questions\"],\"articleSection\":[\"Recursion and Iteration\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/recursion-and-iteration\\\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/recursion-and-iteration\\\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/recursion-and-iteration\\\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\\\/\",\"name\":\"Recursion and Iteration Examples - wikitechy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"datePublished\":\"2021-08-28T17:17:58+00:00\",\"dateModified\":\"2021-09-03T06:08:31+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"Recursion and Iteration Examples- Decision making - The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won\u2019t.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/recursion-and-iteration\\\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/editor\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Recursion and Iteration Examples - wikitechy","description":"Recursion and Iteration Examples- Decision making - The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won\u2019t.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/","og_locale":"en_US","og_type":"article","og_title":"Recursion and Iteration Examples - wikitechy","og_description":"Recursion and Iteration Examples- Decision making - The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won\u2019t.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/","og_site_name":"Wikitechy","article_published_time":"2021-08-28T17:17:58+00:00","article_modified_time":"2021-09-03T06:08:31+00:00","author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/"},"author":{"name":"Editor","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"headline":"The construct \u201cif (condition) then A else B\u201d is used for which of the following purposes ?","datePublished":"2021-08-28T17:17:58+00:00","dateModified":"2021-09-03T06:08:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/"},"wordCount":119,"commentCount":0,"keywords":["decision making and branching in c","decision making and looping in c","decision making statement program","decision making statements","decision making statements in c","decision making statements in c with examples","if else statement in c","if statement in c","looping statements in c","switch statement in c++","TCS Ninja Coding Questions with Answers | TCS Ninja Coding Questions 2021 | TCS Ninja Programming MCQ Questions"],"articleSection":["Recursion and Iteration"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/","name":"Recursion and Iteration Examples - wikitechy","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-08-28T17:17:58+00:00","dateModified":"2021-09-03T06:08:31+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"Recursion and Iteration Examples- Decision making - The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won\u2019t.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/recursion-and-iteration\/the-construct-if-condition-then-a-else-b-is-used-for-which-of-the-following-purposes\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=2648"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2648\/revisions"}],"predecessor-version":[{"id":2660,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2648\/revisions\/2660"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=2648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=2648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=2648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}