A few years back when I first got into programming, I vividly remember searching “how to code” on YouTube and clicking on the first video I saw. That video was a C programming tutorial by FreeCodeCamp. It was a 4 hour long video that I watched and rewatched over and over and over. I was obsessed.I did not take long but after about a week, I moved on to C++. The main differences between C and C++ is that C is what is known as a procedural language and does not support objects and classes, while C++ is essentially just an extension of C that supports objects and classes. Although I started out learning C, I would highly recommend beginners who are just starting out to check out languages like python and JavaScript, as they are much easier to pick up on.
Full transparency, these days I primarily code in Python and I do hold some bias towards the language. But within the past year, I have become infatuated with the world of cybersecurity, reverse engineering and malware analysis. As I continue down this path, I am noticing that C and C++ (along with a few other languages) are used more than others. I have decided to start posting snippets of a few projects I have worked on, ranging from beginner to intermediate level, that were crucial in my skill development as a programmer.
Hypotenuse Triangle Calculator
The title is pretty self explanatory. The snippets below will show code for a calculator that returns the hypotenuse of a triangle when 2 sides ( a and b) are given. Also provided are snippets of the terminal to show the correct outputs you should receive if you happen to be following along on your own devices.

** I would also like to note that I do note usually space my code like this but did so intentionally for readability **

The terminal snippet above shows the values 3 and 4 being used for a and b. When inserted into the hypotenuse equation, it produces the value of 5. Again, this is an example of a beginner level project that is really gets the user familiar with different libraries, math functions and the simpler things like variables and strings. Questions, comments and critiques are always welcome!

Leave a comment