/* EEEE1001/H61CAE Chapter 8 */ /* Example of a simple if statements */ #include /* Standard include files */ #include #include /* Required for getch() */ int main( void ) { char c; /* Define an char */ c = getch(); /* Get value - no return required*/ switch (c) /* Start of switch */ { case '1': printf("Hi"); /* Case 1 */ case '2': printf("Bye"); /* Case 2 */ break; default : printf("Err"); /* Default */ break; } return 0; }