{"id":4931,"date":"2022-10-03T12:05:56","date_gmt":"2022-10-03T12:05:56","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=4931"},"modified":"2022-10-03T12:05:56","modified_gmt":"2022-10-03T12:05:56","slug":"what-is-the-use-of-printf-and-scanf-functions","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/","title":{"rendered":"What is the use of printf() and scanf() functions ?"},"content":{"rendered":"<h2 id=\"\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4932 aligncenter\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg\" alt=\"\" width=\"875\" height=\"435\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg 875w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf-300x149.jpg 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf-768x382.jpg 768w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf-390x194.jpg 390w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf-820x408.jpg 820w\" sizes=\"(max-width: 875px) 100vw, 875px\" \/><\/h2>\n<h2 id=\"scanf\" style=\"text-align: justify;\"><strong>Scanf()<\/strong><\/h2>\n<ul style=\"text-align: justify;\">\n<li>Scanf() is the most commonly used in C langauage.<\/li>\n<li>They are inbuilt functions in the c program which is in the stdio.h(header file).<\/li>\n<li>It is an input function in the c program that takes input values from the user.<\/li>\n<li>It is a function that reads formatted data from stdin(standard input stream), which is keyboard, unless redirected, and then writes the results to arguments.<\/li>\n<\/ul>\n<h2 id=\"printf\" style=\"text-align: justify;\"><strong>Printf()<\/strong><\/h2>\n<ul style=\"text-align: justify;\">\n<li>Printf() is used to display the output.<\/li>\n<li>They are inbuilt functions in the c program which is in the stdio.h(header file).<\/li>\n<li>It is a function that prints a string on the screen using a format string that contains mix of several strings.<\/li>\n<li>It produces a final string to be printed on the screen.<\/li>\n<li>It is an output function in the c program that prints output values to the console.<\/li>\n<\/ul>\n<p>\u00a0<\/p>\n<p style=\"text-align: justify;\">\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>Scanf() Scanf() is the most commonly used in C langauage. They are inbuilt functions in the c program which is in the stdio.h(header file). It is an input function in the c program that takes input values from the user. It is a function that reads formatted data from stdin(standard input stream), which is keyboard, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1716],"tags":[18787,18786,18797,18792,18785,18788,18791,18790,18798,18795,18796,18794,18793,18789],"class_list":["post-4931","post","type-post","status-publish","format-standard","hentry","category-c","tag-c-input-output","tag-c-printf-and-scanf-functions","tag-fprintf-in-c","tag-printf-and-scanf-functions-in-c","tag-printf-scanf-in-c","tag-printf-and-scanf","tag-return-values-of-printf-and-scanf-in-c","tag-scanf-and-printf-in-c","tag-scanf-string-in-c","tag-scanf-syntax","tag-scanf-used-for","tag-syntax-of-printf-in-c","tag-use-of-printf-in-c","tag-what-is-the-use-of-printf-and-scanf-functions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is the use of printf() and scanf() functions ? - Printf scanf in C<\/title>\n<meta name=\"description\" content=\"What is the use of printf() and scanf() functions ? - Scanf() is the most commonly used in C langauage.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the use of printf() and scanf() functions ? - Printf scanf in C\" \/>\n<meta property=\"og:description\" content=\"What is the use of printf() and scanf() functions ? - Scanf() is the most commonly used in C langauage.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-03T12:05:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg\" \/>\n<meta name=\"author\" content=\"webmaster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webmaster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/\"},\"author\":{\"name\":\"webmaster\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"headline\":\"What is the use of printf() and scanf() functions ?\",\"datePublished\":\"2022-10-03T12:05:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/\"},\"wordCount\":149,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/difference-between-scanf-and-printf.jpg\",\"keywords\":[\"c input\\\/output\",\"c printf() and scanf() functions\",\"fprintf in c\",\"printf and scanf functions in c\",\"printf scanf in c\",\"printf() and scanf()\",\"return values of printf() and scanf() in c\",\"scanf and printf in c\",\"scanf string in c\",\"scanf syntax\",\"scanf() used for\",\"syntax of printf in c\",\"use of printf in c\",\"what is the use of printf() and scanf() functions\"],\"articleSection\":[\"C\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/\",\"name\":\"What is the use of printf() and scanf() functions ? - Printf scanf in C\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/difference-between-scanf-and-printf.jpg\",\"datePublished\":\"2022-10-03T12:05:56+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"description\":\"What is the use of printf() and scanf() functions ? - Scanf() is the most commonly used in C langauage.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/c\\\/what-is-the-use-of-printf-and-scanf-functions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/difference-between-scanf-and-printf.jpg\",\"contentUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/difference-between-scanf-and-printf.jpg\",\"width\":875,\"height\":435},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\",\"name\":\"webmaster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"caption\":\"webmaster\"},\"sameAs\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\"],\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/webmaster\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the use of printf() and scanf() functions ? - Printf scanf in C","description":"What is the use of printf() and scanf() functions ? - Scanf() is the most commonly used in C langauage.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/","og_locale":"en_US","og_type":"article","og_title":"What is the use of printf() and scanf() functions ? - Printf scanf in C","og_description":"What is the use of printf() and scanf() functions ? - Scanf() is the most commonly used in C langauage.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/","og_site_name":"Wikitechy","article_published_time":"2022-10-03T12:05:56+00:00","og_image":[{"url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg","type":"","width":"","height":""}],"author":"webmaster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webmaster","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/"},"author":{"name":"webmaster","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"headline":"What is the use of printf() and scanf() functions ?","datePublished":"2022-10-03T12:05:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/"},"wordCount":149,"commentCount":0,"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg","keywords":["c input\/output","c printf() and scanf() functions","fprintf in c","printf and scanf functions in c","printf scanf in c","printf() and scanf()","return values of printf() and scanf() in c","scanf and printf in c","scanf string in c","scanf syntax","scanf() used for","syntax of printf in c","use of printf in c","what is the use of printf() and scanf() functions"],"articleSection":["C"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/","name":"What is the use of printf() and scanf() functions ? - Printf scanf in C","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg","datePublished":"2022-10-03T12:05:56+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"description":"What is the use of printf() and scanf() functions ? - Scanf() is the most commonly used in C langauage.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/c\/what-is-the-use-of-printf-and-scanf-functions\/#primaryimage","url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg","contentUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/10\/difference-between-scanf-and-printf.jpg","width":875,"height":435},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4","name":"webmaster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","caption":"webmaster"},"sameAs":["https:\/\/www.wikitechy.com\/interview-questions"],"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=4931"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4931\/revisions"}],"predecessor-version":[{"id":4933,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4931\/revisions\/4933"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=4931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=4931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=4931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}