Today we will be looking at loops and control statements in C. By this point, assuming you’ve followed the other tutorials on the blog, you should be very familiar with these structures.
In C, we have access to:
- if
- else if
- else
- switch
For our conditional statements. And then for our loops we have access to:
- for
- while
- do while
Examples of these can be found below:


You may notice they look very similar, practically identical even, to the syntax for the loops and conditionals in Java. It’s one of the reasons why people tend to say once you have learned one language, you can easily pick up more.
But C also has another kind of control statement; “goto”. This statement essentially tells the code to jump to a specific point in the code. Whilst this may seem great on paper, it is recommended to avoid goto, as it cam lead to buggy code, or code that is too hard to follow. It can also allow you to jump out of the scope, which can be problematic for variables in the program.
And this concludes the C tutorial series, next we’ll be going through C++. If you haven’t checked out any of the previous tutorial series, I’d highly recommend you do so. Please consider subscribing to either YouTube channel or the blog if you haven’t done so already.
Thank you very much for reading and I’ll catch you in the next one.