move exercises and lectures into subfolders

This commit is contained in:
2023-10-15 15:34:53 +01:00
parent 775b4bd643
commit 74092a17aa
177 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#include <stdio.h>
#include <stdlib.h>
// Simple function to populate an integer array
void PopulateTheArray ( int Size, int ArrayData[])
{
int i; // Variable to use in our loop
for ( i = 0 ; i < Size ; i++)
{
ArrayData[i] = 2*i + 1; // Treat it like a normal array
}
}
// Simple function to display contents of an integer array
void DisplayTheArray ( int Size, int ArrayData[])
{
int i; // Variable to use in our loop
for ( i = 0 ; i < Size ; i++)
{
printf ("Item %d of the array contains %d\n", i, ArrayData[i]);
}
}
// Main () - execution starts here
int main (void)
{
int Data[10];
// Pass the size of the array and the array to our function -
// remembering that the array name on its own is the base address,
// and so is the same as passing &Data[0]
PopulateTheArray(10, Data);
DisplayTheArray(10, Data);
return (0); // Exit indicating sucess
}