How a C Program Run

how a c program run

how a c program runHow a C Program Runs: First of all, a program is coding. Then the program is compiled. By compiling, any programmable program in C program runs a certain Execution Flow, under which high level codes change into binary digits of machine language, which our computer can understand. We can try to understand the execution of the “C” program with a block diagram or a flow chart:how a c program run

  • First of all, we will start the computer and create a program by writing the “C” language code in a Text Editor. This is called the Source Program.
  • After creating the program, it corrects any kind of syntax error by editing the Edit Source Program Block.
  • Now compile the program by the “C” compiler, to help the program understand the computer in its machine language.
  • If there is a mistake related to any other syntax in this program, then the program control goes back to the same Edit Source Program Block for all the Source Editing with all the mistakes.
  • When there is no syntax error in the program, then Program Control links those System Library Files into programs, which are used in the Function Program. As all the Functions of Input / Output are stored in the Header File named stdio.h, hence this Header File is included in every C program to get the facility of I / O. Program Control links all the required Header files to the program.
  • Then in the next stage, Data Input is done from the user and the program remains Execute. Now if there is any kind of logical mistake then the mistake comes in the next process box. If it is a mistake, Program Control reaches the Edit Source Program Block, and all the whole process is adopted to debug the program again. But if the program does not have any errors, then the program gives Correct Output and ends.

In this way the full program is Step-By-Step Execute.

Simple Structure of C Program

main() //Function
     Function Body;

This is a simple Representation of any program. Whenever a program compiles, the compiler first finds the main function and starts its execution of the program from Opening Curly Brace. All executable codes are written between these opening and closing curly brace ({…}).

The statements of the beginning and end of any Function are written between the same brackets, whether it is User Defined Functions or the Main Function, while the end of every Statement of the program is done by a “;” Semicolon sign and The end of the function is from the closing curly brace.

I sincerely hope that I have given you full information about How a C Program Run and I hope you have understood about How a C Program Run. I am convinced of all the readers that you too share this information with your neighbors, relatives, your friends, so that we will be aware of our interactions and will all benefit from it. I need people’s support from you so that I can bring you even more new information.

My always try is to do that I always help my readers or readers on every side, if you have any doubt of any kind, then you can ask me uncomfortable. I will definitely try to solve those Doubts. Please tell us what you think of this article, so that we can get a chance to learn something from your thoughts and improve some.

Get new posts by email
Please follow and like us: