Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c program that replace vowels in a string with char

#include <stdio.h>

int main()
{
	int i,k;
	char arr[50];
	
	printf("Enter char: ");
	gets(arr);
	k=strlen(arr);
	for(i=0;i<k;++i){
		if(arr[i]=='a'||arr[i]=='e'||arr[i]=='i'||arr[i]=='o'||arr[i]=='u'||arr[i]=='A'||arr[i]=='E'||arr[i]=='I'||arr[i]=='O'||arr[i]=='U'){
			printf("_");
		}
		else{
			printf("%c",arr[i]);
		}
	}
} 
 
 
PREVIOUS NEXT
Tagged: #program #replace #vowels #string #char
ADD COMMENT
Topic
Name
4+6 =