Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Introduction to the C Programming Language

Anwarul Bashir Shuaib

August 7, 2020

1 Introduction
Welcome to your first class on the C Programming Language. As you might already know,
C is one of the oldest and most powerful programming languages out there, making it
widely popular in the early days of the programming era. Even today, C is still so relevant
that many other programming languages and thousands of libraries are still written in C.
Due to its dominance and flexibility, some might even consider it saying ‘The mother of all
programming languages’ (including our dear SLR sir).

2 Setting up the environment


In this class, you will learn how to setup the proper environment for compiling and running
a basic C program. I will guide you through the steps of setting up the environment, and if
you follow those steps correctly, you’ll be able to successfully compile your first C program.

2.1 Installing IDE and running your first program


Although you can compile your C program using just the command line, using a good IDE
(Integrated Development Environment) will make your life easier as never before. We will
be using CodeBlocks as our IDE, since your college labs will also be using this same IDE.

1. Go to http://www.codeblocks.org and click downloads

1
2. Click download the binary release

3. Download the mingw-setup.exe from FossHUB/SourceForge.

2
4. Wait for the download to finish.

3
5. When the download has finished, run the installer.

4
6. Choose your appropriate installation folder. If you are not sure, leave that as it is.
Click install.

7. It should take 2-3 minutes to complete the installation depending on your computer.
When you’ve finished installing, run CodeBlocks from Desktop or Start menu short-
cut. Click on File → New → Empty File.

5
8. Hit Ctrl+S to save your file. Give it any name you like, but be sure to add the .c
extension at the end of your file name.

9. Type the following code.

6
10. Click Build and Run

2.2 Your first output


If you’ve followed the above steps correctly, you should see a similar output like the one
below:

7
3 Conclusion
Congratulations! You’ve compiled and run your first C program! But this is just the start
of your journey. There are billions of awesome things you can do with your program!

This class was just a quick overview of setting up your proper environment to get
yourself started in C programming. In the next class, we will discuss each and every
statement of the program you just wrote, discuss elaborately what each statement does
and give you a brief idea about various data types and format specifiers.

If you had faced any problems during installation, please do not hesitate to mail me at
1805010@ugrad.cse.buet.ac.bd . See you again in the next class!

You might also like