-
Notifications
You must be signed in to change notification settings - Fork 1
/
ch1.c
46 lines (42 loc) · 987 Bytes
/
ch1.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<stdio.h>
#include<string.h>
/*int main()
{
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, the string will be : %s",str);
return 0;
}*/
int main(){
char str[20],s[20];
int i,j=0;
printf("Enter any string->");
scanf("%s",str);
printf("The string is->%s",str);
for(i=0;i<=strlen(str);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[i]=' ';}
else
{s[j++]=str[i];}
}
s[j]='\0';
printf("\nThe string without vowel is->%s",s);
return 0;
}