Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,939 questions

51,876 answers

573 users

How to remove vowels from a string in C

1 Answer

0 votes
#include <stdio.h>

int main()
{
    char str[] = "c java python vb.net";

    int j = 0;
    for (int i = 0; i < str[i]; i++) {
        if (str[i] != 'a' && str[i] != 'e' && str[i] != 'i' && str[i] != 'o' && str[i] != 'u' &&
            str[i] != 'A' && str[i] != 'E' && str[i] != 'I' && str[i] != 'O' && str[i] != 'U') {
            str[j] = str[i];
            j++;
        }
    }

    str[j] = '\0';

    puts(str);

    return 0;
}




/*
run:

c jv pythn vb.nt

*/

 



answered Mar 27, 2022 by avibootz

Related questions

4 answers 213 views
213 views asked Aug 18, 2019 by avibootz
1 answer 95 views
1 answer 111 views
111 views asked Nov 21, 2022 by avibootz
1 answer 111 views
111 views asked Nov 21, 2022 by avibootz
1 answer 105 views
1 answer 127 views
1 answer 93 views
...