Concept of Development steps in C program explained in a detail manner
In order to develop any c program , we have to follow some steps. Let's see those steps.
1.Coding phase .
2.Compilation phase ( a software called compiler is used ) .
3.Linking phase ( a software called linker is used ) .
4.Loading phase ( a software called loader is used ) .
5.Execution phase .
These are the various phases of C program .
1.Coding phase :
• During coding phase , the corresponding program is returned with the help of C language , the extension for C program is (.c) .
• So any C program must end with a extension ( .c ).
2.Compilation phase :
• During compilation phase ( a software called compiler is user ). Let's see what is a compiler ? Compiler translates our program in to a machine code .
• Why because computer doesn't understand our program language because our program contains some alphabets, digits, symbol but computer can't understand all those things .
• Computer can understand only 2 bytes . They are 0's and 1's { (i.e) 1st byte - 0 , 2nd byte -1 } for that purpose compiler translate our program into machine code ( It is in the form of 0's and 1's ).
• So let's what is compilation ?
Compilation means it is a process of checking whether program contains any syntax errors or not .
• If the program contains any syntax errors then those error will be reported to the users , if the program is successfully compiled that means if the program doesn't contain any syntax errors then the compiler generate object file . The extension for object file is (.obj) .
• Here syntax error means in C language we have several syntaxes like every statement end with semicolon (;) , function definition never ends with semicolon , if there are multiple variable separated with comma and for declaring a variable , after data type we need to use space . So likewise we have several syntaxes .
• If the program doesn't follow those syntaxes then it will reports the corresponding message to the user.(Object file means there are no error in the corresponding program).
• So the user should correct those error in the program .
3.Linking phase :
• The linker links the object code of several library functions to the main program.
• In program , we uses several library functions like printf , scanf , function , strcpy function like we have several library functions but our compiler doesn't understand those library function because those library function available in some header files .
• So during linking phase what will happen is the linker links the object code of several library function to the main function .
• If we take strlen function, there is a library function which is available in string.h . So what will happen now is that the linker links the strlen function to our main program . So , now our compiler can understand what is the duty of strlen function . Here is the output of linker is (.exe file ) . So the linker produces .exe file ( exe stands for executable file ) .
• If executable file is generated that means the program is ready for execution .
4.Loading phase :
• During loading phase ( a software called loader is used ) . The loader loads the corresponding executable file into the main memory for the execution .
• We have two types of memory (main memory and secondary memory ) . The program is executed by CPU ( Central processing unit ) . But CPU executes a program only if the program decides in main memory only .
• During coding phase , compilation phase , and linking phase the program decides in secondary memory whereas during loading phase what will happen is the program will be loaded into the main memory .
• Why because a CPU executes a program only when the program decides in main memory only . So loading the program into main memory is done by loader .
• So if the program is available in the main memory then the CPU can executes our program .
5.Execution phase :
• It is a process of checking whether the program produces correct result or not . So if the program produces correct result then there is no problem . If the program doesn't produce correct result then it specifies that there are two errors .
◆ First error is Logical .
◆ Second error is Exceptions .
• Logical error means some logical mistake is there . For example , let we want to add 2 number , then the numbers are 10 , 30 so after adding two numbers 40 will be the correct output . But let us assume that we want output as 60 . So this is nothing but a logical error .
• One more example , let the program is reversing a given number 2 4 6 after reversing the number 6 4 2 will be the correct output but we got our output as 2 4 6 only . So this is nothing but logical errors .
Exceptions :
Exceptions are nothing but run-time error .
Hope you all understand the concept✌🏼.
Drop your thoughts about this article in the comment section👇🏻.
Please don't forget to follow me & like my article 👍🏻.
Please Read computer knowledge team blog.
Enjoy Learning Programming language !
Stay tuned for more concepts ✌🏻 .