{"id":1023,"date":"2020-04-05T04:45:40","date_gmt":"2020-04-05T04:45:40","guid":{"rendered":"https:\/\/rndpedia.com\/blog\/?p=400"},"modified":"2024-06-19T10:05:17","modified_gmt":"2024-06-19T10:05:17","slug":"write-a-program-to-show-the-effect-of-getcheand-getch","status":"publish","type":"post","link":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/","title":{"rendered":"Write a program to show the effect of getche()and getch()."},"content":{"rendered":"<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include&lt;stdio.h&gt;\n#include&lt;conio.h&gt;\nint main()\n{\n\tprintf(&quot;Enter any two alphabetic&quot;);\n\tgetche();\n\tgetch();\n}\n\n\/*\nTwo characters are entered,the user can see only one character on the screen.The second character is\naccepted but not console.\nThe getche() accepts and display the character where as getch() accept but not display the character.\nSyntax of getche() is as follows:-\ngetche();*\/\n<\/pre><\/div>\n\n\n<p>The program is designed to demonstrate the difference between the <code>getche()<\/code> and <code>getch()<\/code> functions in the <code>conio.h<\/code> library.<\/p>\n\n\n\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-1910841001912053\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- horizintal -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-1910841001912053\"\n     data-ad-slot=\"8832200140\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>First, the program displays the message &#8220;Enter any two alphabetic&#8221;. Then, the <code>getche()<\/code> function is called to read and display a single character input from the user, which is visible on the screen. Next, the <code>getch()<\/code> function is called to read a single character input from the user, but this input is not displayed on the screen.<\/p>\n\n\n\n<p>The difference between these two functions is that <code>getche()<\/code> reads a character and displays it on the screen, while <code>getch()<\/code> reads a character but does not display it. Both functions are commonly used in console-based programs to read user input without the need for the user to press the enter key.<\/p>\n\n\n\n<p>Thanks<\/p>\n\n\n\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-1910841001912053\"\n     crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-format=\"autorelaxed\"\n     data-ad-client=\"ca-pub-1910841001912053\"\n     data-ad-slot=\"6076785113\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>The program is designed to demonstrate the difference between the getche() and getch() functions in the conio.h library. First, the program displays the message &#8220;Enter any two alphabetic&#8221;. Then, the getche() function is called to read and display a single character input from the user, which is visible on the screen. Next, the getch() function [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[48,91,117,120],"class_list":["post-1023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c","tag-char","tag-effect","tag-getch","tag-getche"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Write a program to show the effect of getche()and getch(). - Nesark | Tutorials<\/title>\n<meta name=\"description\" content=\"Well as you know, getch() reads a single byte character from input. getch() is a way to get .Same effect can be achieved by using getche() function.\" \/>\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.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Write a program to show the effect of getche()and getch(). - Nesark | Tutorials\" \/>\n<meta property=\"og:description\" content=\"Well as you know, getch() reads a single byte character from input. getch() is a way to get .Same effect can be achieved by using getche() function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/\" \/>\n<meta property=\"og:site_name\" content=\"Nesark | Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nesarktech\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-05T04:45:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-19T10:05:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ram Nath Das\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ram Nath Das\" \/>\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.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/\"},\"author\":{\"name\":\"Ram Nath Das\",\"@id\":\"https:\/\/www.nesark.com\/blog\/#\/schema\/person\/5282df381645953288b5502b89a86126\"},\"headline\":\"Write a program to show the effect of getche()and getch().\",\"datePublished\":\"2020-04-05T04:45:40+00:00\",\"dateModified\":\"2024-06-19T10:05:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/\"},\"wordCount\":131,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png\",\"keywords\":[\"char\",\"effect\",\"getch()\",\"getche()\"],\"articleSection\":[\"C Program\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/\",\"url\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/\",\"name\":\"Write a program to show the effect of getche()and getch(). - Nesark | Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png\",\"datePublished\":\"2020-04-05T04:45:40+00:00\",\"dateModified\":\"2024-06-19T10:05:17+00:00\",\"description\":\"Well as you know, getch() reads a single byte character from input. getch() is a way to get .Same effect can be achieved by using getche() function.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage\",\"url\":\"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png\",\"contentUrl\":\"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.nesark.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Write a program to show the effect of getche()and getch().\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.nesark.com\/blog\/#website\",\"url\":\"https:\/\/www.nesark.com\/blog\/\",\"name\":\"Nesark | Tutorials\",\"description\":\"Blog\",\"publisher\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.nesark.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.nesark.com\/blog\/#organization\",\"name\":\"Nesark Worldservices Pvt. Ltd.\",\"url\":\"https:\/\/www.nesark.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.nesark.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2021\/10\/Mask-Group-7.png\",\"contentUrl\":\"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2021\/10\/Mask-Group-7.png\",\"width\":200,\"height\":59,\"caption\":\"Nesark Worldservices Pvt. Ltd.\"},\"image\":{\"@id\":\"https:\/\/www.nesark.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/nesarktech\",\"https:\/\/www.linkedin.com\/company\/nesarktech\",\"https:\/\/www.youtube.com\/nesarktech\",\"https:\/\/www.instagram.com\/nesarktech\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.nesark.com\/blog\/#\/schema\/person\/5282df381645953288b5502b89a86126\",\"name\":\"Ram Nath Das\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.nesark.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/059938dcfb66a295197ca697bf38c5947e4b3fae2e51dfbbbdb1d44f2c3a893f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/059938dcfb66a295197ca697bf38c5947e4b3fae2e51dfbbbdb1d44f2c3a893f?s=96&d=mm&r=g\",\"caption\":\"Ram Nath Das\"},\"description\":\"I'm a results-driven professional with a passion for leveraging digital strategies to drive business growth. With 6 years of experience in the dynamic fields of marketing, social media, Google - Facebook Ads and SMS marketing, I specialize in creating impactful campaigns that resonate with audiences and deliver measurable results. Let's Connect: I believe in the power of networking and collaboration. Feel free to reach out, connect, or send me a message. Together, we can uncover new possibilities and chart a course for success in the ever-evolving digital landscape. Thank you.\",\"sameAs\":[\"https:\/\/www.nesark.com\/blog\"],\"url\":\"https:\/\/www.nesark.com\/blog\/author\/ramnathdas6\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Write a program to show the effect of getche()and getch(). - Nesark | Tutorials","description":"Well as you know, getch() reads a single byte character from input. getch() is a way to get .Same effect can be achieved by using getche() function.","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.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/","og_locale":"en_US","og_type":"article","og_title":"Write a program to show the effect of getche()and getch(). - Nesark | Tutorials","og_description":"Well as you know, getch() reads a single byte character from input. getch() is a way to get .Same effect can be achieved by using getche() function.","og_url":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/","og_site_name":"Nesark | Tutorials","article_publisher":"https:\/\/www.facebook.com\/nesarktech","article_published_time":"2020-04-05T04:45:40+00:00","article_modified_time":"2024-06-19T10:05:17+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png","type":"image\/png"}],"author":"Ram Nath Das","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ram Nath Das","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#article","isPartOf":{"@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/"},"author":{"name":"Ram Nath Das","@id":"https:\/\/www.nesark.com\/blog\/#\/schema\/person\/5282df381645953288b5502b89a86126"},"headline":"Write a program to show the effect of getche()and getch().","datePublished":"2020-04-05T04:45:40+00:00","dateModified":"2024-06-19T10:05:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/"},"wordCount":131,"commentCount":0,"publisher":{"@id":"https:\/\/www.nesark.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage"},"thumbnailUrl":"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png","keywords":["char","effect","getch()","getche()"],"articleSection":["C Program"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/","url":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/","name":"Write a program to show the effect of getche()and getch(). - Nesark | Tutorials","isPartOf":{"@id":"https:\/\/www.nesark.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage"},"image":{"@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage"},"thumbnailUrl":"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png","datePublished":"2020-04-05T04:45:40+00:00","dateModified":"2024-06-19T10:05:17+00:00","description":"Well as you know, getch() reads a single byte character from input. getch() is a way to get .Same effect can be achieved by using getche() function.","breadcrumb":{"@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#primaryimage","url":"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png","contentUrl":"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2020\/04\/Screenshot-152.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/www.nesark.com\/blog\/write-a-program-to-show-the-effect-of-getcheand-getch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.nesark.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Write a program to show the effect of getche()and getch()."}]},{"@type":"WebSite","@id":"https:\/\/www.nesark.com\/blog\/#website","url":"https:\/\/www.nesark.com\/blog\/","name":"Nesark | Tutorials","description":"Blog","publisher":{"@id":"https:\/\/www.nesark.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.nesark.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.nesark.com\/blog\/#organization","name":"Nesark Worldservices Pvt. Ltd.","url":"https:\/\/www.nesark.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.nesark.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2021\/10\/Mask-Group-7.png","contentUrl":"https:\/\/www.nesark.com\/blog\/wp-content\/uploads\/2021\/10\/Mask-Group-7.png","width":200,"height":59,"caption":"Nesark Worldservices Pvt. Ltd."},"image":{"@id":"https:\/\/www.nesark.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/nesarktech","https:\/\/www.linkedin.com\/company\/nesarktech","https:\/\/www.youtube.com\/nesarktech","https:\/\/www.instagram.com\/nesarktech"]},{"@type":"Person","@id":"https:\/\/www.nesark.com\/blog\/#\/schema\/person\/5282df381645953288b5502b89a86126","name":"Ram Nath Das","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.nesark.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/059938dcfb66a295197ca697bf38c5947e4b3fae2e51dfbbbdb1d44f2c3a893f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/059938dcfb66a295197ca697bf38c5947e4b3fae2e51dfbbbdb1d44f2c3a893f?s=96&d=mm&r=g","caption":"Ram Nath Das"},"description":"I'm a results-driven professional with a passion for leveraging digital strategies to drive business growth. With 6 years of experience in the dynamic fields of marketing, social media, Google - Facebook Ads and SMS marketing, I specialize in creating impactful campaigns that resonate with audiences and deliver measurable results. Let's Connect: I believe in the power of networking and collaboration. Feel free to reach out, connect, or send me a message. Together, we can uncover new possibilities and chart a course for success in the ever-evolving digital landscape. Thank you.","sameAs":["https:\/\/www.nesark.com\/blog"],"url":"https:\/\/www.nesark.com\/blog\/author\/ramnathdas6\/"}]}},"_links":{"self":[{"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/posts\/1023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/comments?post=1023"}],"version-history":[{"count":1,"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/posts\/1023\/revisions"}],"predecessor-version":[{"id":1249,"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/posts\/1023\/revisions\/1249"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/media\/420"}],"wp:attachment":[{"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/media?parent=1023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/categories?post=1023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nesark.com\/blog\/wp-json\/wp\/v2\/tags?post=1023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}