ADD_A.C

LIB3/SECURE/SIMUL_EF/ADD_A.C · 383 B

From the archive nm4dos.zip

Download the archive   « Back to the archive contents

string  add_a( string s )	/* adds 'a' or 'an' on to the string as appropriate */
{
    int     i;

    i = 0;
    while( s[ i ] == ' ' )
	i++;

    switch( s[ i ] )
    {
	case 'a':
	case 'e':
	case 'i':
	case 'o':
	case 'u':
	case 'A':
	case 'E':
	case 'I':
	case 'O':
	case 'U':
	    return "an " + s[ i..1000 ];
	default:
	    return "a " + s[ i..1000 ];
    }
}				/* add_a() */

Site Stats

Snippets: 1791
Codebases: 571