Professional Documents
Culture Documents
W2-3 Basics C Component
W2-3 Basics C Component
W2-3 Basics C Component
OR
INTRODUCTION
C structured language :
Sequential statement
Selection statement (if..else)
Repetition statement (do..while, for.., while)
A COMPLETE C PROGRAM
Comments will not
be executed by
compiler
/*.*/ OR //.
Pre-processor statement /
library
main() function
entry point for all
programs / start here
all C statements
MUST end with ;
1. COMMENTS
Format :
/* .. */
// .
code to be generated.
Help other people read and understand your program
2. PREPROCESSOR DIRECTIVES
Format :
3. main() Function
Format :
execution in completed
caller
3. main() Function
quotation marks
Like any other statement, printf() must end with ;
Conversion specifier types of data that need to be displayed
Address operator = & = the address of the variable in memory
5. Escape Sequence
Format : \<special character>
\ is called escape character. Combining \ with a set of
memory