{"id":26569,"date":"2017-05-31T21:03:41","date_gmt":"2017-05-31T15:33:41","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=26569"},"modified":"2017-05-31T21:03:41","modified_gmt":"2017-05-31T15:33:41","slug":"c-program-to-delete-vowels-from-a-string","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/c-program-to-delete-vowels-from-a-string\/","title":{"rendered":"C program to delete vowels from a string"},"content":{"rendered":"<p>C program to delete vowels from a <a href=\"https:\/\/www.wikitechy.com\/technology\/c-program-to-convert-string-to-integer-without-using-atoi-function\/\">string <\/a>: c program to remove or delete vowels from a string, if the input string is \u201cc programming\u201d then output will be \u201cc prgrmmng\u201d. In the program we create a new string and process entered string character by <a href=\"https:\/\/www.wikitechy.com\/technology\/reverse-string-in-c\/\">character<\/a>, and if a vowel is found it is not added to new string otherwise the character is added to new string, after the string ends we copy the new <a href=\"https:\/\/www.wikitechy.com\/technology\/reverse-string-in-c\/\">string <\/a>into original string. Finally we obtain a string without any vowels.<\/p>\n[ad type=\u201dbanner\u201d]\n<h2 id=\"c-programming-code\">C programming code<\/h2>\n[pastacode lang=\u201dc\u201d manual=\u201d%23include%20%3Cstdio.h%3E%0A%23include%20%3Cstring.h%3E%0A%20%0Aint%20check_vowel(char)%3B%0A%20%0Aint%20main()%0A%7B%0A%20%20char%20s%5B100%5D%2C%20t%5B100%5D%3B%0A%20%20int%20i%2C%20j%20%3D%200%3B%0A%20%0A%20%20printf(%22Enter%20a%20string%20to%20delete%20vowels%5Cn%22)%3B%0A%20%20gets(s)%3B%0A%20%0A%20%20for(i%20%3D%200%3B%20s%5Bi%5D%20!%3D%20\u2019%5C0\u2019%3B%20i%2B%2B)%20%7B%0A%20%20%20%20if(check_vowel(s%5Bi%5D)%20%3D%3D%200)%20%7B%20%20%20%20%20%20%20%2F%2Fnot%20a%20vowel%0A%20%20%20%20%20%20t%5Bj%5D%20%3D%20s%5Bi%5D%3B%0A%20%20%20%20%20%20j%2B%2B%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%0A%20%20t%5Bj%5D%20%3D%20\u2019%5C0\u2019%3B%0A%20%0A%20%20strcpy(s%2C%20t)%3B%20%20%20%20%2F%2FWe%20are%20changing%20initial%20string%0A%20%0A%20%20printf(%22String%20after%20deleting%20vowels%3A%20%25s%5Cn%22%2C%20s)%3B%0A%20%0A%20%20return%200%3B%0A%7D%0A%20%0A%20%0Aint%20check_vowel(char%20c)%0A%7B%0A%20%20switch(c)%20%7B%0A%20%20%20%20case%20\u2019a\u2019%3A%0A%20%20%20%20case%20\u2019A\u2019%3A%0A%20%20%20%20case%20\u2019e\u2019%3A%0A%20%20%20%20case%20\u2019E\u2019%3A%0A%20%20%20%20case%20\u2019i\u2019%3A%0A%20%20%20%20case%20\u2019I\u2019%3A%0A%20%20%20%20case%20\u2019o\u2019%3A%0A%20%20%20%20case%20\u2019O\u2019%3A%0A%20%20%20%20case%20\u2019u\u2019%3A%0A%20%20%20%20case%20\u2019U\u2019%3A%0A%20%20%20%20%20%20return%201%3B%0A%20%20%20%20default%3A%0A%20%20%20%20%20%20return%200%3B%0A%20%20%7D%0A%7D\u201d message=\u201d\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<p><strong>Output of program:<\/strong><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-26570\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/without-vowels.png\" alt=\"C program to delete vowels from a string\" width=\"317\" height=\"119\" srcset=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/without-vowels.png 317w, https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/05\/without-vowels-300x113.png 300w\" sizes=\"(max-width: 317px) 100vw, 317px\" \/><\/p>\n<h2 id=\"c-programming-code-using-pointers\">C programming code using pointers<\/h2>\n[ad type=\u201dbanner\u201d]\n[pastacode lang=\u201dc\u201d manual=\u201d%23include%3Cstdio.h%3E%0A%23include%3Cstdlib.h%3E%0A%23include%3Cstring.h%3E%0A%23define%20TRUE%201%0A%23define%20FALSE%200%0A%20%0Aint%20check_vowel(char)%3B%0A%20%0Amain()%0A%7B%0A%20%20%20char%20string%5B100%5D%2C%20*temp%2C%20*pointer%2C%20ch%2C%20*start%3B%0A%20%0A%20%20%20printf(%22Enter%20a%20string%5Cn%22)%3B%0A%20%20%20gets(string)%3B%0A%20%0A%20%20%20temp%20%3D%20string%3B%0A%20%20%20pointer%20%3D%20(char*)malloc(100)%3B%0A%20%0A%20%20if(%20pointer%20%3D%3D%20NULL%20)%0A%20%20%20%7B%0A%20%20%20%20%20%20printf(%22Unable%20to%20allocate%20memory.%5Cn%22)%3B%0A%20%20%20%20%20%20exit(EXIT_FAILURE)%3B%0A%20%20%20%7D%0A%20%0A%20%20%20start%20%3D%20pointer%3B%0A%20%0A%20%20%20while(*temp)%0A%20%20%20%7B%0A%20%20%20%20%20%20ch%20%3D%20*temp%3B%0A%20%0A%20%20%20%20%20%20if%20(%20!check_vowel(ch)%20)%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20*pointer%20%3D%20ch%3B%0A%20%20%20%20%20%20%20%20%20pointer%2B%2B%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20temp%2B%2B%3B%0A%20%20%20%7D%0A%20%20%20*pointer%20%3D%20\u2019%5C0\u2019%3B%0A%20%0A%20%20%20pointer%20%3D%20start%3B%0A%20%20%20strcpy(string%2C%20pointer)%3B%20%2F*%20If%20you%20wish%20to%20convert%20original%20string%20*%2F%0A%20%20%20free(pointer)%3B%0A%20%0A%20%20%20printf(%22String%20after%20removing%20vowel%20is%20%5C%22%25s%5C%22%5Cn%22%2C%20string)%3B%0A%20%0A%20%20%20return%200%3B%0A%7D%0A%20%0Aint%20check_vowel(char%20a)%0A%7B%0A%20%20%20if%20(%20a%20%3E%3D%20\u2019A\u2019%20%26%26%20a%20%3C%3D%20\u2019Z\u2019%20)%0A%20%20%20%20%20%20a%20%3D%20a%20%2B%20\u2019a\u2019%20-%20\u2019A\u2019%3B%0A%20%0A%20%20%20if%20(%20a%20%3D%3D%20\u2019a\u2019%20%7C%7C%20a%20%3D%3D%20\u2019e\u2019%20%7C%7C%20a%20%3D%3D%20\u2019i\u2019%20%7C%7C%20a%20%3D%3D%20\u2019o\u2019%20%7C%7C%20a%20%3D%3D%20\u2019u\u2019)%0A%20%20%20%20%20%20return%20TRUE%3B%0A%20%0A%20%20%20return%20FALSE%3B%0A%7D\u201d message=\u201d\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n","protected":false},"excerpt":{"rendered":"<p>C program to delete vowels from a string &#8211; C Programming &#8211; In the program we create a new string and process entered string character by character.<\/p>\n","protected":false},"author":2,"featured_media":26581,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69866],"tags":[79175,79176,79177,79197,79183,79184,73163,73158,79189,79178,79179,79188,79185,79192,79190,79180,79187,79181,79194,79193,79170,79172,79169,79198,74751,79195,76930,73395,79196,76938,79186,73148,73458,79191,79182,76922,79173,79171,79174],"class_list":["post-26569","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-program-to-delete-a-character-from-a-string","tag-c-program-to-delete-consonants-in-a-string","tag-c-program-to-delete-vowels-from-a-string","tag-c-program-to-find-vowels-and-consonants-in-a-string","tag-c-program-to-find-vowels-in-a-string","tag-c-program-to-print-vowels-in-a-string","tag-c-string-compare","tag-c-string-functions","tag-char-to-string-java-java-string-replace","tag-delete-string-c","tag-delete-string-in-c","tag-java-char-to-string","tag-java-program-to-find-vowels-and-consonants-in-a-string","tag-java-program-to-find-vowels-in-a-string","tag-javascript-remove-character-from-string","tag-new-string","tag-python-remove-character-from-string","tag-python-trim-string","tag-remove-character-from-string","tag-remove-last-character-from-string-c","tag-remove-vowels-from-a-string-in-c","tag-remove-vowels-from-string-c","tag-remove-vowels-from-string-java","tag-replace-string-java","tag-string-compare-in-c","tag-string-erase","tag-string-functions-in-c","tag-string-in-c","tag-string-in-c-programming","tag-string-manipulation-in-c","tag-string-methods","tag-string-programs-in-c","tag-string-programs-in-java","tag-string-remove","tag-string-slice","tag-strings-in-c","tag-wap-to-enter-the-string-remove-the-blank-spaces-from-the-string","tag-wap-to-remove-the-vowels-from-the-input-string-in-java","tag-write-a-c-program-to-add-all-elements-of-a-matrix-by-using-dynamic-memory-allocation"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/26569","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=26569"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/26569\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media\/26581"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=26569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=26569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=26569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}