[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"academy-blogs-en-1-1-all-enhance-program-intelligence-with-if-else-go-ep3-all--*":3,"academy-blog-faqs-ytz22o0fle9leiy-en":86,"academy-blog-translations-ytz22o0fle9leiy":87},{"data":4,"page":72,"perPage":72,"totalItems":72,"totalPages":72},[5],{"alt":6,"collectionId":7,"collectionName":8,"content":9,"cover_image":10,"cover_image_l_url":11,"cover_image_m_url":12,"cover_image_path":13,"cover_image_s_url":14,"created":15,"created_by":16,"expand":17,"id":80,"keywords":81,"locale":52,"published_at":82,"scheduled_at":60,"school_blog":76,"short_description":83,"status":74,"title":6,"updated":84,"updated_by":85,"slug":77,"views":79},"EP.3 Enhance Your Program's Intelligence with If-Else in Go","sclblg987654321","school_blog_translations","\u003Cp>\u003Cspan style=\"font-size:20px;\">\u003Cstrong>Enhance Your Program's Intelligence with If-Else in Go\u003C\u002Fstrong>\u003C\u002Fspan>\u003C\u002Fp>\u003Cp>Have you ever wondered how programs make decisions? For instance, if the data is correct, they proceed; if not, they send an alert. This is the role of If-Else, which helps programs make intelligent decisions.\u003C\u002Fp>\u003Cp>What is If-Else? In every program, we need decision-making. For example, if the user enters the correct information, they can log in; if it's incorrect, an error notification is displayed. Using If-Else allows the program to function based on conditions.\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">package main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n    age := 20\r\n    if age &gt;= 18 {\r\n        fmt.Println(\"You are an adult.\")\r\n    } else {\r\n        fmt.Println(\"You are not an adult.\")\r\n    }\r\n}\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cspan style=\"font-size:18px;\">\u003Cstrong>Structure of If-Else in Go\u003C\u002Fstrong>\u003C\u002Fspan>\u003C\u002Fp>\u003Cul style=\"list-style-type:circle;\">\u003Cli>if condition {}: If the condition is true, this block will execute.\u003C\u002Fli>\u003Cli>else {}: If the condition is false, this block will execute.\u003C\u002Fli>\u003C\u002Ful>\u003Cp>You can add multiple conditions using else if, for example:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">score := 85\r\nif score &gt;= 90 {\r\n    fmt.Println(\"Grade A\")\r\n} else if score &gt;= 80 {\r\n    fmt.Println(\"Grade B\")\r\n} else {\r\n    fmt.Println(\"Grade C\")\r\n}\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cstrong>Using Comparison Operators\u003C\u002Fstrong>\u003Cbr>When writing conditions in If-Else, we use comparison operators such as:\u003C\u002Fp>\u003Cul>\u003Cli>== equals\u003C\u002Fli>\u003Cli>!= not equals\u003C\u002Fli>\u003Cli>&gt; greater than\u003C\u002Fli>\u003Cli>&lt; less than\u003C\u002Fli>\u003Cli>&gt;= greater than or equal to\u003C\u002Fli>\u003Cli>&lt;= less than or equal to\u003C\u002Fli>\u003C\u002Ful>\u003Cp>Example:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">number := 10\r\nif number % 2 == 0 {\r\n    fmt.Println(\"Even number\")\r\n} else {\r\n    fmt.Println(\"Odd number\")\r\n}\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>All of this will help learners understand how to control program execution with If-Else, which is a fundamental aspect of creating smarter programs.\u003C\u002Fp>","5_11zon_6e70dtoh97.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fyk2ce2j4f5epk77\u002Fl\u002F5_11zon_6e70dtoh97.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fyk2ce2j4f5epk77\u002Fm\u002F5_11zon_6e70dtoh97.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fyk2ce2j4f5epk77\u002F5_11zon_6e70dtoh97.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fyk2ce2j4f5epk77\u002Fs\u002F5_11zon_6e70dtoh97.webp","2026-03-04 08:51:56.184Z","76qprkevbgfdps8",{"keywords":18,"locale":46,"school_blog":56},[19,26,31,36,41],{"collectionId":20,"collectionName":21,"created":22,"created_by":16,"id":23,"name":24,"updated":25,"updated_by":16},"sclkey987654321","school_keywords","2026-03-04 08:34:25.224Z","i9bl5yxbuh8vdw3","else if","2026-06-07 06:46:06.585Z",{"collectionId":20,"collectionName":21,"created":27,"created_by":16,"id":28,"name":29,"updated":30,"updated_by":16},"2026-03-04 08:34:25.902Z","m3pk809c4skki8w","control flow","2026-06-07 06:46:07.004Z",{"collectionId":20,"collectionName":21,"created":32,"created_by":16,"id":33,"name":34,"updated":35,"updated_by":16},"2026-03-04 08:20:33.316Z","ln1ntwattzmxo0o","programming","2026-06-07 06:45:09.715Z",{"collectionId":20,"collectionName":21,"created":37,"created_by":16,"id":38,"name":39,"updated":40,"updated_by":16},"2026-03-04 08:20:11.547Z","ey3puyme01a9bsw","Go","2026-06-07 06:45:07.798Z",{"collectionId":20,"collectionName":21,"created":42,"created_by":16,"id":43,"name":44,"updated":45,"updated_by":16},"2026-03-04 08:34:28.167Z","vbpls11idbswpbf","If-Else","2026-06-07 06:46:07.837Z",{"code":47,"collectionId":48,"collectionName":49,"created":50,"flag":51,"id":52,"is_default":53,"label":54,"updated":55},"en","pbc_1989393366","locales","2026-01-22 11:00:02.726Z","twemoji:flag-united-states","qv9c1llfov2d88z",false,"English","2026-04-10 15:42:46.825Z",{"category":57,"collectionId":58,"collectionName":59,"created":60,"expand":61,"id":76,"slug":77,"updated":78,"views":79},"wqxt7ag2gn7xcmk","pbc_2105096300","school_blogs","",{"category":62},{"blogIds":63,"collectionId":64,"collectionName":65,"created":66,"created_by":16,"id":57,"image":67,"image_alt":60,"image_path":68,"image_s_url":69,"label":70,"name":71,"priority":72,"publish_at":73,"scheduled_at":60,"status":74,"updated":75,"updated_by":16},[],"sclcatblg987654321","school_category_blogs","2026-03-04 08:33:53.210Z","59ty92ns80w_15oc1implw_bj2o4tjgh4.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fwqxt7ag2gn7xcmk\u002F59ty92ns80w_15oc1implw_bj2o4tjgh4.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fwqxt7ag2gn7xcmk\u002Fs\u002F59ty92ns80w_15oc1implw_bj2o4tjgh4.webp",{"en":71,"th":71},"Golang The Series",1,"2026-03-16 04:39:38.440Z","published","2026-08-18 14:48:36.739Z","ytz22o0fle9leiy","enhance-program-intelligence-with-if-else-go-ep3","2026-10-20 08:35:18.794Z",521,"yk2ce2j4f5epk77",[23,28,33,38,43],"2025-01-21 07:02:41.540Z","Learn how to use If-Else and else if in Go language to effectively control your program's execution.","2026-09-25 07:53:28.078Z","ebkf8ra4nd55ual",[],{"th":77,"en":77}]