Partially changed file structure to suit VSCode

This commit is contained in:
Louise Brown
2022-10-24 14:01:59 +01:00
parent 1c0a9e7b6a
commit a2c8695634
29 changed files with 30 additions and 21 deletions

34
LC8/Switch2/switch_2.c Normal file
View File

@@ -0,0 +1,34 @@
/* Chapter 8 */
/* Example of a simple if statements */
#include <stdio.h> /* Standard include files */
#include <stdlib.h>
#include <conio.h> /* Required for getch() */
int main( void )
{
char c; /* Define an char */
c = getch(); /* Get value */
switch (c) /* Start of switch */
{
case '1':
printf("Hi"); /* Case 1 */
break;
case '2':
printf("Bye"); /* Case 2 */
break;
default :
printf("Err"); /* Default */
break;
}
return 0;
}