View Single Post
Old Feb 23rd, 2005, 9:49 PM   #7
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
At the top of your program add this header...
#include <ctype.h>

char determineContents_if(char gasCode) {
    gasCode = toupper(gasCode); // Convert to uppercase

    if (gasCode == 'B')
        printf ("\nBrown - Carbon Monoxide\n");
    else if (gasCode == 'O')
        printf ("\n Orange - Ammonia\n");
    else if (gasCode == 'G')
        printf ("\nGreen - Oxygen\n");
    else if (gasCode == 'Y')
        printf ("\nYellow - Hydrogen\n");
    else
        printf ("\nInvalid Character\n");

    return 0;
}
__________________

tempest is offline   Reply With Quote