< Back Next >

Before we dive into writing programs, Let us understand some basics of a computer program.

What is a Computer program?

"A program code is a sequence of instructions written in a computer programming language such as C or Java, which instructs the computer to perform a specific operation."

For example – If I ask you to give me the recipe for making tea, you might tell me something like this

Step 1: Take a cup of water.

Step 2: Add some tea leafs

Step 3: Then add some sugar

Step 4: And add some milk

Step 5: Now boil for some time

Step 6: The Tea is ready!

Of course, you may give something better for the tea recipe, but this is just an example.

What you just told me in the form of tea recipe is the steps to make tea in the English language. Similarly, to make the computer do something, we need to give it recipes like that in the form of program code.

Now lets come back to computer programming, which is a sequence of a finite set of instructions for the computer to perform a specific task.

In C programming language to print a simple hello world text on the console, this is what you will write -

File name - hello.c
int main()
    printf("Hello World");
Now let's compile and run the above code.


 gcc hello.c


Hello World

Don't get worried if you have not understood the code, in the upcoming chapters you will learn about it.

In the next chapter, we will set up our system to be able to compile and execute c programs.

Sharing is caring: