{"id":24854,"date":"2017-10-15T12:17:15","date_gmt":"2017-10-15T06:47:15","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=24854"},"modified":"2017-10-15T12:17:15","modified_gmt":"2017-10-15T06:47:15","slug":"captcha-program-c","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/captcha-program-c\/","title":{"rendered":"Captcha program in c"},"content":{"rendered":"<p>This program generates captcha, a captcha is a random code generated using some algorithm. We will use random function in our code. These are used in typing tutors and in website to check whether a human is operating on a website.<\/p>\n<h2 id=\"c-programming-code\">C programming code<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-c code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-c code-embed-code\">#include&lt;stdlib.h&gt;<br\/>#include&lt;dos.h&gt;<br\/>#include&lt;graphics.h&gt;<br\/> <br\/>main()<br\/>{<br\/>   int i = 0, key, num, midx, gd = DETECT, gm;<br\/>   char a[10];<br\/> <br\/>   initgraph(&amp;gd,&amp;gm,&quot;C:\\\\TC\\\\BGI&quot;);<br\/> <br\/>   midx = getmaxx()\/2;<br\/> <br\/>   settextstyle(SCRIPT_FONT,HORIZ_DIR,5);<br\/>   settextjustify(CENTER_TEXT,CENTER_TEXT);<br\/>   setcolor(GREEN);<br\/>   outtextxy(midx,20,&quot;CAPTCHA&quot;);<br\/>   settextstyle(SCRIPT_FONT,HORIZ_DIR,2);<br\/>   outtextxy(midx,125,&quot;Press any key to change the generated random code \\&quot;captcha\\&quot;&quot;);<br\/>   outtextxy(midx,150,&quot;Press escape key to exit...&quot;);<br\/> <br\/>   setcolor(WHITE);<br\/>   setviewport(100,200,600,400,1);<br\/>   setcolor(RED);<br\/>   randomize();<br\/> <br\/>   while(1)<br\/>   {<br\/>      while(i&lt;6)<br\/>      {<br\/>         num = random(3);<br\/> <br\/>         if ( num == 0 )<br\/>            a[i] = 65 + random(26);     \/* 65 is the ASCII value of A *\/<br\/>         else if ( num == 1)<br\/>            a[i] = 97 + random(26);     \/* 97 is the ASCII value of a *\/<br\/>         else<br\/>            a[i] = 48 + random(10);     \/* 48 is the ASCII value of 0 *\/<br\/>         i++;<br\/>      }<br\/>      a[i] = &#039;\\0&#039;;<br\/>      outtextxy(210,100,a);<br\/>      key = getch();<br\/> <br\/>      if( key == 27 )                     \/* escape key*\/<br\/>         exit(0);<br\/>      clearviewport();<br\/>      i = 0;<br\/>   }<br\/>}<\/code><\/pre> <\/div>\n[ad type=&#8221;banner&#8221;]\n","protected":false},"excerpt":{"rendered":"<p>Captcha program in c &#8211; c programming &#8211; We will use random function in our code. These are used in typing tutors and in website to check.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82927,1],"tags":[83232,83231,83225,83229,83230,83227,83228,83226],"class_list":["post-24854","post","type-post","status-publish","format-standard","hentry","category-c-programming-2","category-coding","tag-captcha-code-in-java-spring","tag-captcha-code-in-python-example","tag-captcha-generation-in-c","tag-captcha-generation-in-python","tag-how-to-design-captcha-in-java","tag-how-to-generate-captcha-in-python","tag-how-to-generate-text-captcha-in-python","tag-implement-a-program-to-generate-and-verify-captcha-image-in-c"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=24854"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24854\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=24854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=24854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=24854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}