{"id":14531,"date":"2025-04-16T22:14:12","date_gmt":"2025-04-16T15:14:12","guid":{"rendered":"https:\/\/www.krujeen.com\/?p=14531"},"modified":"2025-04-16T22:15:54","modified_gmt":"2025-04-16T15:15:54","slug":"%e0%b8%84%e0%b8%b3%e0%b8%aa%e0%b8%b1%e0%b9%88%e0%b8%87%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b9%80%e0%b8%97%e0%b8%84%e0%b8%99%e0%b8%b4%e0%b8%84%e0%b9%83%e0%b8%99%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%a7%e0%b8%b2","status":"publish","type":"post","link":"https:\/\/www.krujeen.com\/?p=14531","title":{"rendered":"\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e41\u0e25\u0e30\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e43\u0e19\u0e01\u0e32\u0e23\u0e27\u0e32\u0e14\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a (Pattern) \u0e43\u0e19 C++"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.krujeen.com\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-16-2025-10_12_05-PM-1024x683.png\" alt=\"\" class=\"wp-image-14532\" srcset=\"https:\/\/www.krujeen.com\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-16-2025-10_12_05-PM-1024x683.png 1024w, https:\/\/www.krujeen.com\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-16-2025-10_12_05-PM-300x200.png 300w, https:\/\/www.krujeen.com\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-16-2025-10_12_05-PM-768x512.png 768w, https:\/\/www.krujeen.com\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-Apr-16-2025-10_12_05-PM.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. \u0e23\u0e39\u0e1b\u0e2a\u0e35\u0e48\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21\u0e40\u0e15\u0e47\u0e21<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">void drawSquare(int size) {\n    for (int i = 0; i &lt; size; i++) {\n        for (int j = 0; j &lt; size; j++) {\n            cout &lt;&lt; \"* \";\n        }\n        cout &lt;&lt; endl;\n    }\n}\n\n\/\/ \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c (size = 4):\n\/\/ * * * *\n\/\/ * * * *\n\/\/ * * * *\n\/\/ * * * *<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. \u0e23\u0e39\u0e1b\u0e2a\u0e32\u0e21\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">void drawTriangle(int height) {\n    for (int i = 1; i &lt;= height; i++) {\n        for (int j = 1; j &lt;= i; j++) {\n            cout &lt;&lt; \"* \";\n        }\n        cout &lt;&lt; endl;\n    }\n}\n\n\/\/ \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c (height = 4):\n\/\/ *\n\/\/ * *\n\/\/ * * *\n\/\/ * * * *<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. \u0e23\u0e39\u0e1b\u0e2a\u0e35\u0e48\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21\u0e01\u0e25\u0e27\u0e07<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">void drawHollowSquare(int size) {\n    for (int i = 1; i &lt;= size; i++) {\n        for (int j = 1; j &lt;= size; j++) {\n            if (i == 1 || i == size || j == 1 || j == size) {\n                cout &lt;&lt; \"* \";\n            } else {\n                cout &lt;&lt; \"  \";\n            }\n        }\n        cout &lt;&lt; endl;\n    }\n}\n\n\/\/ \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c (size = 4):\n\/\/ * * * *\n\/\/ *     *\n\/\/ *     *\n\/\/ * * * *<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. \u0e23\u0e39\u0e1b\u0e2a\u0e32\u0e21\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21\u0e01\u0e25\u0e31\u0e1a\u0e2b\u0e31\u0e27<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">void drawInvertedTriangle(int height) {\n    for (int i = height; i >= 1; i--) {\n        for (int j = 1; j &lt;= i; j++) {\n            cout &lt;&lt; \"* \";\n        }\n        cout &lt;&lt; endl;\n    }\n}\n\n\/\/ \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c (height = 4):\n\/\/ * * * *\n\/\/ * * *\n\/\/ * *\n\/\/ *<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><b>5. \u0e23\u0e39\u0e1b<\/b><strong style=\"font-weight: bold;\">\u0e2a\u0e32\u0e21\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22<\/strong><strong>\u0e21\u0e15\u0e31\u0e27\u0e40\u0e25\u0e02<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">void drawNumberPattern(int rows) {\n    for (int i = 1; i &lt;= rows; i++) {\n        for (int j = 1; j &lt;= i; j++) {\n            cout &lt;&lt; j &lt;&lt; \" \";\n        }\n        cout &lt;&lt; endl;\n    }\n}\n\n\/\/ \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c (rows = 4):\n\/\/ 1\n\/\/ 1 2\n\/\/ 1 2 3\n\/\/ 1 2 3 4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6. \u0e23\u0e39\u0e1b\u0e2a\u0e32\u0e21\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp line-numbers\">void drawPyramid(int height) {\n    for (int i = 1; i &lt;= height; i++) {\n        \/\/ \u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e0a\u0e48\u0e2d\u0e07\u0e27\u0e48\u0e32\u0e07\n        for (int j = 1; j &lt;= height - i; j++) {\n            cout &lt;&lt; \" \";\n        }\n        \/\/ \u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e14\u0e32\u0e27\n        for (int k = 1; k &lt;= 2 * i - 1; k++) {\n            cout &lt;&lt; \"*\";\n        }\n        cout &lt;&lt; std::endl;\n    }\n}\n\n\/\/ \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c (height = 4):\n\/\/    *\n\/\/   ***\n\/\/  *****\n\/\/ *******<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0e43\u0e0a\u0e49\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23 <code>char<\/code> \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e2a\u0e31\u0e0d\u0e25\u0e31\u0e01\u0e29\u0e13\u0e4c\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e27\u0e32\u0e14<\/li>\n\n\n\n<li>\u0e43\u0e0a\u0e49 nested loop \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21\u0e41\u0e16\u0e27\u0e41\u0e25\u0e30\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c<\/li>\n\n\n\n<li>\u0e43\u0e0a\u0e49\u0e40\u0e07\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e02 if-else \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e27\u0e48\u0e32\u0e08\u0e30\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e2d\u0e30\u0e44\u0e23\u0e43\u0e19\u0e41\u0e15\u0e48\u0e25\u0e30\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07<\/li>\n\n\n\n<li>\u0e43\u0e0a\u0e49 arithmetic progression \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e33\u0e19\u0e27\u0e13\u0e08\u0e33\u0e19\u0e27\u0e19\u0e2a\u0e31\u0e0d\u0e25\u0e31\u0e01\u0e29\u0e13\u0e4c\u0e43\u0e19\u0e41\u0e15\u0e48\u0e25\u0e30\u0e41\u0e16\u0e27<\/li>\n\n\n\n<li>\u0e43\u0e0a\u0e49 modulo operator (%) \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48\u0e0b\u0e31\u0e1a\u0e0b\u0e49\u0e2d\u0e19\u0e02\u0e36\u0e49\u0e19<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e2b\u0e21\u0e32\u0e22\u0e40\u0e2b\u0e15\u0e38:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e1b\u0e23\u0e31\u0e1a\u0e02\u0e19\u0e32\u0e14\u0e02\u0e2d\u0e07\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e42\u0e14\u0e22\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e04\u0e48\u0e32 parameter \u0e17\u0e35\u0e48\u0e2a\u0e48\u0e07<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. \u0e23\u0e39\u0e1b\u0e2a\u0e35\u0e48\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21\u0e40\u0e15\u0e47\u0e21 2. \u0e23\u0e39\u0e1b\u0e2a\u0e32\u0e21\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21 3. \u0e23\u0e39\u0e1b\u0e2a\u0e35\u0e48\u0e40\u0e2b\u0e25\u0e35\u0e48\u0e22\u0e21\u0e01 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":14532,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[155,156],"tags":[160],"class_list":["post-14531","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programing","category-c_language","tag-c"],"_links":{"self":[{"href":"https:\/\/www.krujeen.com\/index.php?rest_route=\/wp\/v2\/posts\/14531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.krujeen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.krujeen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.krujeen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.krujeen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14531"}],"version-history":[{"count":2,"href":"https:\/\/www.krujeen.com\/index.php?rest_route=\/wp\/v2\/posts\/14531\/revisions"}],"predecessor-version":[{"id":14534,"href":"https:\/\/www.krujeen.com\/index.php?rest_route=\/wp\/v2\/posts\/14531\/revisions\/14534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.krujeen.com\/index.php?rest_route=\/wp\/v2\/media\/14532"}],"wp:attachment":[{"href":"https:\/\/www.krujeen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.krujeen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.krujeen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}