I supplement each tutorial with a number of c programming examples. Here you will find them all in one place!
Recently I started to upload all the C source code examples and demos on ProgrammingSimpleSteps' GitHub.
This is the only place where I will upload new examples and update the existing ones.
git clone https://github.com/ProgrammingSimpleSteps/c-examples.git
Advertise on this site. I promise you will like the rates :)
Note: I will no longer update the source code provided in the .zip files that you can download from here. The preferred way to access the examples is our repository on GitHub. If you are making your first steps in the world of programming you need to learn to navigate GitHub anyway. Also I strongly suggest that you learn how to work with Git itself. It is the most widely used version control system as of today(2021).
You can(and I strongly recommend that you do) download and test the C source code examples on your machine. They are regular .c (source file) and .h (header file) files. For convenience all files in one example are zipped in an archive, so you have to download only one file for one example.
To use them:
That's it :-)
|do-while-loop.zip||do while loop|
|return statement.zip||return statement|
|struct.zip||structure in C|
|switch statement examples||switch statement|
|typedef.zip||typedef in C|
|union.zip||union in C|
|dec-to-bin.zip||Decimal to binary|
|decimal-to-octal.zip||Decimal to octal|
|dec-to-hex.zip||Decimal to hex|
|bin-to-dec.zip||Binary to decimal|
|bin-to-hex.zip||Binary to hex|
|hex-to-decimal.zip||hex to decimal|
|hex-to-bin.zip||hex to binary|
|octal-to-decimal.zip||octal to decimal|
This example uses the dirent.h library to list files in a given folder and rename them with consecutive names like "f-01", "f-02", and so on.
Converting a decimal number to a fraction involves expressing the
decimal as a ratio of two integers (a numerator and a denominator).
Many of you are here, because you are following some of my tutorials and want to see the c programming examples associated with a given lesson.
However, chances are that some of you came here, because you are looking for C source code examples in general. Those of you probably are making your first steps in the world of programming and C in particular. For you, I strongly recommend my C Programming Tutorial, where you will start from the beginning and setup your development environment in order to actually run the C source code examples.