Added book examples

This commit is contained in:
Louise Brown
2022-04-08 16:12:38 +01:00
parent 5b205092a7
commit 1c0a9e7b6a
59 changed files with 1381 additions and 0 deletions

19
C7/getchar_example.c Normal file
View File

@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
// declare variable
char c;
// Wait for a kepypress, store result in c
c = getchar();
// Display on the screen using printf
printf ("The charcter pressed was %c\n", c);
// Display the charcter using putchar()
putchar(c);
return 0; // Exit from main
}