Introduction to C



≫ What is the need of using programming languages?

→ As we know that Computer only understand binary i.e., 0-1 code(1 reffers to "on"and 0 reffers to "off" basically),we need to establish a means through which we can communicate with the computer at this point the programming language comes.

≫ How are Programming languages understood by Computer?

→ C program will undergo this stage:

 I. Pre-processing

 ✔ In this satge Removal of Comments,Expansion of Macros,Expansion of the included files,Conditional compilation.

 II. Compilation(or)Interpretation
 ✔ It convert souce code to assembly code.

 III. Assembly
 ✔ It converts assembly code to object code.

 IV. Linking
 ✔ It converts object code to Executable file.

≫ Structure of C program

→ C program basically consists of the following part :  

I. Preprocessor Commands

 ⇒This are the commands that should be pre processed like including file like stdio.h,string.h,math.h,etc and defining constants.  

II. Functions

 ⇒It is combination or set of command which can be used n number of time by calling it. main() is the first function that will be executed it is called by the OS.  

III.Variables

 ⇒We have to store the number in some address location,remembering the address(to access the value)is hard so we use name which point to that address so we can use that name instead in every place.  

IV. Statements & Expressions

1. Simple statements
2. Compound statements
  i. Conditionals
  ii. Loops

V.Comments

 ⇒This line of commands are not executed, they are avoided.