{"id":1635,"date":"2022-08-30T15:18:10","date_gmt":"2022-08-30T15:18:10","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/undefined-reference-to-printf-do-we-need-to-link-the-library-for-printf-also-like-libm-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:10","modified_gmt":"2022-08-30T15:18:10","slug":"undefined-reference-to-printf-do-we-need-to-link-the-library-for-printf-also-like-libm-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/undefined-reference-to-printf-do-we-need-to-link-the-library-for-printf-also-like-libm-collection-of-common-programming-errors\/","title":{"rendered":"Undefined reference to &#39;printf&#39; ?????? Do we need to link the library for printf also like libm-Collection of common programming errors"},"content":{"rendered":"<p>Here is the code &#8230;<\/p>\n<pre><code>\/*Program to print a menu driven program*\/\n\/*Author:Udit gupta     Date:09\/08\/2011*\/\n\n#include\n#include\n\nint main () {\n\n    int fact=1,i=1,n;\n\n    while (1) {\n\n    printf(\"Please select one of the following options............\\n\");\n    printf(\"1. Factorial\\n\");\n    printf(\"2. Prime or Not\\n\");\n    printf(\"3. Odd or Even\\n\");\n    printf(\"5. Exit\\n\");\n\n    prinf (\"\\n\\tEnter the value :\");\n            scanf (\"%d\",&amp;n);\n\n\n    switch (n) {\n\n            case 1 :\n\n                    while (i<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-27 12:10:23. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Here is the code &#8230; \/*Program to print a menu driven program*\/ \/*Author:Udit gupta Date:09\/08\/2011*\/ #include #include int main () { int fact=1,i=1,n; while (1) { printf(&#8220;Please select one of the following options&#8230;&#8230;&#8230;&#8230;\\n&#8221;); printf(&#8220;1. Factorial\\n&#8221;); printf(&#8220;2. Prime or Not\\n&#8221;); printf(&#8220;3. Odd or Even\\n&#8221;); printf(&#8220;5. Exit\\n&#8221;); prinf (&#8220;\\n\\tEnter the value :&#8221;); scanf (&#8220;%d&#8221;,&amp;n); switch (n) { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1635","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1635"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1635\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}