lecture_02.pdf - Data structures and algorithms C-Program Structure Institute of Technology of Cambodia Electrical and Energy Engineering Department

lecture_02.pdf - Data structures and algorithms C-Program...

This preview shows page 1 - 12 out of 17 pages.

Data structures and algorithms Institute of Technology of Cambodia Electrical and Energy Engineering Department C-Program Structure
Content Setting up your computer for DSA class: Windows A simple C-Program Structure C-Basic syntax
Hardware and software requirement Notice below requirement for DSA class: A computer running windows operating system Install codeblock_version_xx.xx with mingw-setup.
Codeblock interface
A simple “Hello World” program Let us look at simplest Hello World program
Pre-processing The line starts with # is called pre-processing command. It tells a C compiler to include stdio.h file before going to actual compilation.
Main function The next line int main () is the main function where the program execution begins
Comment The next line /*…*/ will be ignored by the compiler and it has been put to add additional comment in the program. So such lines are called comment in the program
C-Statement The next line printf (…) is another function available in C which causes the message “Hello World!” to displayed on the screen.
C-Statement (cont.) C Statements are sequential statements
C-Terminate statement The next line return 0; terminates the main() function and returns the value 0.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture