C program to find vowels and remove vowels , C/C++ Programming

C Program to FIND VOWELS AND REMOVE VOWELS

void main()

{

          char s[100],s1[100];

          int i,j,k=0;

          clrscr();

          printf("ENTER ANY STRING: ");

          gets(s);

          for(i=0;s[i]!='\0';i++)

          {

if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u' || s[i]=='A' || s[i]=='E' || s[i]=='I' || s[i]=='O' || s[i]=='U')

                   {

                             k++;

                             printf("\nTHE VOWELS ARE: %c",s[i]);

                             j=i;

                             do{

                             s[j]=s[j+1];

                             j++;

                             }while(s[j]!='\0');

                   }

          }

          printf("\nTHE TOTAL VOWELS ARE: %d",k);

          printf("\nAFTER REMOVING THE VOWELS,THE NEW STRING IS: %s",s);

          getch();

 

}

 

OUTPUT :

 

ENTER THE STRING: KAMLESH MENGAR

 

THE VOWELS ARE: A

THE VOWELS ARE: E

THE VOWELS ARE: A

THE VOWELS ARE: E

TOTAL NO OF VOWELS ARE : 4

 

AFTER REMOVING THE VOWELS, THE NEW STRING IS : KMLSH MNGR

 

Posted Date: 9/10/2012 2:49:33 AM | Location : United States







Related Discussions:- C program to find vowels and remove vowels , Assignment Help, Ask Question on C program to find vowels and remove vowels , Get Answer, Expert's Help, C program to find vowels and remove vowels Discussions

Write discussion on C program to find vowels and remove vowels
Your posts are moderated
Related Questions
(a) Verify the values of the resistors with the following colour coding: (i) red-red-orange-silver (ii) orange-orange-black-blue-green (b) What is the value of a resistor


#Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.   #include float start_poi

What is the difference between = symbol and == symbol? - The = symbol is generally used in mathematical operations. It's used to assign a value to a given variable whereas the

Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year.

I have an exercise with 2 problems. One that is partially completed except with read problems with memory overwrite, and the other problem. I have enclosed the instructions documen

Define a function in c program: int f1() { static int x=10; return x; } int f2() { int y=5; return y; } extern int z; void f()     {

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst. Shortest remaining time rst algori

char P[100]; double X=533.8*22500; sprintf(P,"%f %u",X,(unsigned int)X); MessageBox(P,"SSS"); //12010500.000 12010499

Problem: (a) Show the Java approach to event processing by explaining how event handling works in Java. Make use of a suitable example to support your answer. (b) Describe