Results 1 to 4 of 4

Thread: Help with result only...

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    9

    Help with result only...

    It serves to show only member of a sentence. like you type "house" he show "oue".
    i want the result like this "o-u-e" can anyone give me a tip?


    Code:
    #include<conio.h>
    #include<stdio.h>
    #include<string.h>
    int main()
    {
        
        char str[30],vogal[]={'a','e','i','o','u','A','E','I','O','U'} ,k[40];
        char a;
        int cont=0,i,qtd,aux=0;
    
         printf(" Digite uma palavra: ");
         fflush(stdin);
         scanf("%s",str); 
         qtd=strlen(str);     
         
    for(cont=0;cont<qtd;cont++)
       for(i=0;i<10;i++) 
        if(str[cont]==vogal[i])
          k[aux++]=str[cont];
          k[++aux]='0';     
               
    k[aux-1]=NULL;
    printf(" \n        %s ",k);
    getch();
    }

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Help with result only...

    Is this, by chance, homework?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    Re: Help with result only...

    so you're trying to find the vowels in a given word?

  4. #4
    Member
    Join Date
    Apr 2008
    Posts
    42

    Re: Help with result only...

    "member" of a sentence? TF?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width