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
Program is to reverse the names stored in an array pointer: Program is to reverse the 6 names stored in an array pointer as name[] void main()   {  clrscr();  char

Using a Friend Using a friend function is quite easy. The following example explains a friend function to access members of two classes. class Bclass;

Given a bool variable isReadable write some statements that assign true to isReadable if the file "topsecret" exists and can be read by the program and assigns false to isR

Project Description: I have software written with VB that i helped design, but now the original author died,(Neil Tromp), and the software ended up in the hands of someone else!

Question 1 What are the different steps in executing a C program? Explain Question 2 What are the commonly used input/output functions in C? How are they accessed?

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

C program to demonstrate Pointer to array: void p2a(int *); void main() {                 int x=10, *a,**b;                 int arr[5];                 a=&x;//po

Yes. "Memory pools" are useful in many situations. The bad news is that I'll need to drag you through the mire of how it acts before we talk about all the uses. Firstly, recall

Write a C program to input five numbers and print them out on a new line e.g 5, 10, 15, 20, 25 displayed as   5   10   15   20   25 #include stdio.h   void main()   {