I have this problem to solve, I basically need to allow the user to input a text up to 80 characters in length. Once the string has been input, the program will have to go through each character and printing them one at the time but changing the vowel with different characters ( $,#,@,* and = ). I think I have been able to write a code that sort of work but if the user input a text with a space in it, the program will print just the text before the space, everything after the space won't be printed.
example:
input: someTEXT!eg45a6I7uX
output:s*m#T#XT!#g45$6@7=X
But:
input: Hello Students
output: H#ll*
{
char text[80];
scanf("%s", text);
int current =0;
printf(">\n");
while(text[current] != '\0')
{
switch(text[current])
{
case 'a':
printf("$");
break;
case 'A':
printf("$");
break;
case 'e':
printf("#");
break;
case 'E':
printf("#");
break;
case 'i':
printf("@");
break;
case 'I':
printf("@");
break;
case 'o':
printf("*");
break;
case 'O':
printf("*");
break;
case 'u':
printf("=");
break;
case 'U':
printf("=");
break;
default:
printf("%c", text[current]);
}
++current;
}
}