Header Ads Widget

C: BASIC STRUCTURE OF A C PROGRAM - SPARSH BLOG

 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.

Post a Comment

0 Comments