C program to delete vowels from the string.

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
 clrscr();
 char str[20];
 int len, i, j;
 printf("Enter a string : ");
 gets(str);
 len=strlen(str);
 for(i=0; i<len; 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')
  {
   for(j=i; j<len; j++)
   {
    str[j]=str[j+1];
   }
  len--;
  }
 }
 printf("After deleting the vowels: %s",str);
 getch();
}
C program to delete vowels from the string. C program to delete vowels from the string. Reviewed by on December 26, 2019 Rating: 5

No comments:

Powered by Blogger.