 Hi students, in this video we will see what happens when we run a C program. So here you can see that I have written a hello.c file on the desktop, let's open a terminal. So this is the hello.c file and let's have a look at its contents. So it's a very simple C program which has to print hello world and then it returns. So the first thing that we need to do is we need to compile this C program. And what is compilation? So this program is something which we can understand. But CPU cannot understand it as is. And we need to convert this program into instructions that a CPU can understand. So this is exactly what a compiler program like GCC does. It creates an executable file called a.dotaute which contains instructions based on the underlying architecture which is x86 in my case. So if I run GCC space hello.c, it will create an executable file called a.dotaute. So here it is and it contains all the instructions which CPU can understand. So now if I run this a.dotaute, you can see that it printed hello world on the output screen. So what happens when I run this a.dotaute? As we know that every running program is a process. So when I run this program, it will create a new process in the RAM. It will copy this a.dotaute from hard disk to the main memory and create the memory image. And then CPU will start executing the instructions. So is there a way to see all the processes which are there in the RAM? There is a command called top and I will open a new terminal. So this top command shows us a list of all the processes and it updates every few seconds. This changes to update every one second. So I will use this DR argument. So now it is updating every second and it is showing me all the processes. So now what I will do is I will run a.dotaute and try to see a corresponding process in the top output. But there are too many processes. So I will press the o key and filter it based on command equal to a.dotaute. So you can see that there is no process currently running with a.dotaute as command. So if I just directly done a.dotaute, it's too fast to see a process popping up in the top output. So what I will do is I will add a sleep statement in hello.c file so that it first waits for 10 seconds before executing the printf statement. I will save this file and now because we have changed hello.c we need to compile it again to update the executable. Now if I run a.dotaute and go to the second terminal, we can see that there is a new process with a.dotaute as command and this is the PID. So this is the process which is running in CPU. It will wait for 10 seconds and print hello world and after it prints it will exit. So that's the overall life cycle of a C program. We write a C code, we compile it to create an executable which a CPU can understand and when we run an executable, it will create a new process in the RAM and create the memory image. The CPU executes all the instructions and then exits. So that's it for this video. Thanks and have a nice day.