home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sams Teach Yourself C in 21 Days (6th Edition)
/
STYC216E.ISO
/
mac
/
Examples
/
Day13
/
cont.c
< prev
next >
Wrap
C/C++ Source or Header
|
2002-05-04
|
828b
|
38 lines
/* Demonstrates the continue statement. */
#include <stdio.h>
int main( void )
{
/* Declare a buffer for input and a counter variable. */
char buffer[81];
int ctr;
/* Input a line of text. */
puts("Enter a line of text:");
gets(buffer);
/* Go through the string, displaying only those */
/* characters that are not lowercase vowels. */
for (ctr = 0; buffer[ctr] !='\0'; ctr++)
{
/* If the character is a lowercase vowel, loop back */
/* without displaying it. */
if (buffer[ctr] == 'a' || buffer[ctr] == 'e'
|| buffer[ctr] == 'i' || buffer[ctr] == 'o'
|| buffer[ctr] == 'u')
continue;
/* If not a vowel, display it. */
putchar(buffer[ctr]);
}
return 0;
}