move exercises, lecture examples, labs into subfolders

This commit is contained in:
2023-10-13 16:19:51 +01:00
parent a602f20e01
commit 015b5d6a08
200 changed files with 2 additions and 2 deletions

21
Exercises/C9/ex4.c Normal file
View File

@@ -0,0 +1,21 @@
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int age = 1; // Declare variable and initialise to 1
do {
printf ("\nPlease enter your age: ");
scanf("%d", &age);
printf ("You are %d years old\n", age);
if (age == 18 || age == 21) {
printf("You have come of age\n");
}
// Code now goes back and repeats the test with the value of age just entered
} while ( age != 0); // Loop as long as age is not zero
return 0; // Exit code
}