Basic Structure of a C Program - Sparsh Blog
- #include<stdio.h>
👉 It is also called the Preprocessing Command.
👉 It tells compiler that we want stdio.h file in our Program.
- int main()
👉 This is a function.
👉 Our main program starts after this line.
👉 int 🠊 It is a integer that returns the function.
- Printf()
👉 This function is used to print the desired output.
- return 0
👉 Returns the integer to the operating system.
- scanf()
👉 Help to enter the value from the user.
- &
👉 This is used to represent the address of the operator.
- \n
👉 This is a command that used to enter for te new line character.
To make a C program executable compilation takes the following steps:-
- Preprocessing
Remove comments, Expand Macros, Resolve #include statements.
- Compilation
Converts .i file into Assembly Level Language.
.i files are preprocessed output.
- Assembly
Converts .s file into machine level instructions.
.s files are assembly level instructions.
- Linking
It is two types-
- Static Linking
- Dynamic Linking
.dll files are Dynamic Linking
- Loading
Program is loaded in the Ram for Execution.
A Basic HELLO WORLD! program in C language is:-
#include<stdio.h>
void main()
{
printf("Hello World!");
}
THANK YOU FOR READING THIS ARTICLE ON-
If you want to suggest any changes in the program please feel free to contact us in the comment section or you can reach us using Contact us Page.
0 Comments
If you want to give any suggestion regarding the post please feel free to Comment below-