{"id":2332,"date":"2024-11-06T11:53:54","date_gmt":"2024-11-06T11:53:54","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.in\/?p=2332"},"modified":"2024-11-06T12:05:40","modified_gmt":"2024-11-06T12:05:40","slug":"if-else","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2024\/11\/06\/if-else\/","title":{"rendered":"Explain the if-else statement"},"content":{"rendered":"\n<p>The if-else statement is used to make decisions, where if a condition is true, then it will execute a block of code; if it isn\u2019t true (else), then it will execute a different block of code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if(marks == 97) {<br>    \/\/ if marks are 97 then will execute this block of code<br>}<br>else {<br>    \/\/ else it will execute this block of code<br>}<\/pre>\n\n\n\n<p>Below is the C program to demonstrate an if-else statement:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h&gt;\nint main() \n{\n  int a = 10;\n  if(a &lt; 11)\n  {\n    printf(\"A is less than 11\");\n  }\n  else\n  {\n    printf(\"A is equal to or \"\n           \"greater than 11\");\n  }  \n  return 0;\n}\n\n<strong>Output\nA is less than 11<\/strong><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The if-else statement is used to make decisions, where if a condition is true, then&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2332"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=2332"}],"version-history":[{"count":2,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2332\/revisions"}],"predecessor-version":[{"id":2339,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2332\/revisions\/2339"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=2332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=2332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=2332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}