{"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[pastacode lang=\u201dc\u201d manual=\u201d%23include%3Cstdlib.h%3E%0A%23include%3Cdos.h%3E%0A%23include%3Cgraphics.h%3E%0A%20%0Amain()%0A%7B%0A%20%20%20int%20i%20%3D%200%2C%20key%2C%20num%2C%20midx%2C%20gd%20%3D%20DETECT%2C%20gm%3B%0A%20%20%20char%20a%5B10%5D%3B%0A%20%0A%20%20%20initgraph(%26gd%2C%26gm%2C%22C%3A%5C%5CTC%5C%5CBGI%22)%3B%0A%20%0A%20%20%20midx%20%3D%20getmaxx()%2F2%3B%0A%20%0A%20%20%20settextstyle(SCRIPT_FONT%2CHORIZ_DIR%2C5)%3B%0A%20%20%20settextjustify(CENTER_TEXT%2CCENTER_TEXT)%3B%0A%20%20%20setcolor(GREEN)%3B%0A%20%20%20outtextxy(midx%2C20%2C%22CAPTCHA%22)%3B%0A%20%20%20settextstyle(SCRIPT_FONT%2CHORIZ_DIR%2C2)%3B%0A%20%20%20outtextxy(midx%2C125%2C%22Press%20any%20key%20to%20change%20the%20generated%20random%20code%20%5C%22captcha%5C%22%22)%3B%0A%20%20%20outtextxy(midx%2C150%2C%22Press%20escape%20key%20to%20exit\u2026%22)%3B%0A%20%0A%20%20%20setcolor(WHITE)%3B%0A%20%20%20setviewport(100%2C200%2C600%2C400%2C1)%3B%0A%20%20%20setcolor(RED)%3B%0A%20%20%20randomize()%3B%0A%20%0A%20%20%20while(1)%0A%20%20%20%7B%0A%20%20%20%20%20%20while(i%3C6)%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20num%20%3D%20random(3)%3B%0A%20%0A%20%20%20%20%20%20%20%20%20if%20(%20num%20%3D%3D%200%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20a%5Bi%5D%20%3D%2065%20%2B%20random(26)%3B%20%20%20%20%20%2F*%2065%20is%20the%20ASCII%20value%20of%20A%20*%2F%0A%20%20%20%20%20%20%20%20%20else%20if%20(%20num%20%3D%3D%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20a%5Bi%5D%20%3D%2097%20%2B%20random(26)%3B%20%20%20%20%20%2F*%2097%20is%20the%20ASCII%20value%20of%20a%20*%2F%0A%20%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%20%20%20%20a%5Bi%5D%20%3D%2048%20%2B%20random(10)%3B%20%20%20%20%20%2F*%2048%20is%20the%20ASCII%20value%20of%200%20*%2F%0A%20%20%20%20%20%20%20%20%20i%2B%2B%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20a%5Bi%5D%20%3D%20\u2019%5C0\u2019%3B%0A%20%20%20%20%20%20outtextxy(210%2C100%2Ca)%3B%0A%20%20%20%20%20%20key%20%3D%20getch()%3B%0A%20%0A%20%20%20%20%20%20if(%20key%20%3D%3D%2027%20)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20escape%20key*%2F%0A%20%20%20%20%20%20%20%20%20exit(0)%3B%0A%20%20%20%20%20%20clearviewport()%3B%0A%20%20%20%20%20%20i%20%3D%200%3B%0A%20%20%20%7D%0A%7D\u201d message=\u201d\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n[ad type=\u201dbanner\u201d]\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}]}}